Closed tomishima2904 closed 1 year ago
Juman++で形態素解析してフィルタリングした結果は以下の通り
# 全データ (処理前)
count 184385.000000
mean 1073.210158
std 7393.743082
min 1.000000
25% 5.000000
50% 27.000000
75% 174.000000
max 199501.000000
# 全データ (処理後)
count 184385.000000
mean 379.969195
std 2805.228658
min 0.000000
25% 4.000000
50% 17.000000
75% 101.000000
max 180161.000000
# 抽出文が1以上であるデータ
count 177874.000000
mean 393.877801
std 2855.150380
min 1.000000
25% 4.000000
50% 19.000000
75% 109.000000
max 180161.000000
["結婚", "結婚式", "結婚式はお金がかかる"]
の場合、結婚式
が結婚
も包含しているため誤って抽出されてしまう["きのこ","日陰", "斉昭はそれを見て「余はこれまで日陰者であったが、兄が亡くなってはからずも水戸家を継いだ。御三家の格式は非常に重いので表向きのことは変更できないだろうが、内向きのことである食事などには金などかけることはない」と述べ、翌日から部屋住みの頃の食事に変えさせた"]
の場合、きのこ
が本来の使われ方でないのに抽出されてしまう上記の問題に対し、以下のように対処する
target_tokens
というリストに格納する (例. ["犬", "毒", "きのこ",])target_tokens
が全て含まれていたらフィルターを通過し、そうでなければ除去される