Skip to content

Commit

Permalink
screenNamesが設定されている場合は学習に含めない
Browse files Browse the repository at this point in the history
  • Loading branch information
lufia committed Nov 20, 2023
1 parent 673ec43 commit 4243cc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions functions/saba_disambiguator/build/config_sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ bigquery:
projectId: my-project
dataset: my_dataset
table: my_table
# 特定アカウントへの返信または引用かどうかを特徴量の計算に利用します
# スクリーンネームの比較は完全一致です
#
# 以前の挙動を維持するため、screenNamesが未設定の場合は 'mackerel' という文字列を含むかどうかで判定します
screenNames:
- mackerelio
- mackerelio_jp
8 changes: 5 additions & 3 deletions lib/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ func ExtractFeaturesWithOptions(t *twitter2.Tweet, opts ExtractOptions) FeatureV
text := t.Text

fv = append(fv, "BIAS")
fv = append(fv, "ScreenName:"+t.User.UserName)
fv = append(fv, "inReplyToScreenName:"+inReplyToScreenName(t))
fv = append(fv, "screenNameInQuotedStatus:"+screenNameInQuotedStatus(t))
if len(opts.ScreenNames) == 0 {
fv = append(fv, "ScreenName:"+t.User.UserName)
fv = append(fv, "inReplyToScreenName:"+inReplyToScreenName(t))
fv = append(fv, "screenNameInQuotedStatus:"+screenNameInQuotedStatus(t))
}
fv = append(fv, "lang:"+lang(t))
fv = append(fv, "containsNameInScreenName:"+strconv.FormatBool(opts.contains(t.User.UserName)))
fv = append(fv, "includeNameInUserMentions:"+strconv.FormatBool(opts.includeScreenNameInUserMentions(t)))
Expand Down

0 comments on commit 4243cc3

Please sign in to comment.