diff --git a/functions/saba_disambiguator/build/config_sample.yml b/functions/saba_disambiguator/build/config_sample.yml index 505e402..ade2820 100644 --- a/functions/saba_disambiguator/build/config_sample.yml +++ b/functions/saba_disambiguator/build/config_sample.yml @@ -13,6 +13,10 @@ bigquery: projectId: my-project dataset: my_dataset table: my_table +# 特定アカウントへの返信または引用かどうかを特徴量の計算に利用します +# スクリーンネームの比較は完全一致です +# +# 以前の挙動を維持するため、screenNamesが未設定の場合は 'mackerel' という文字列を含むかどうかで判定します screenNames: - mackerelio - mackerelio_jp diff --git a/lib/feature.go b/lib/feature.go index aa184be..dff984a 100644 --- a/lib/feature.go +++ b/lib/feature.go @@ -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)))