の配列のために最も適した文を探すI持っているテキストマイニングのための、次のデータフレーム:トークンのトークン
df = pd.DataFrame({'text':["Anyone who reads Old and Middle English literary texts will be familiar with the mid-brown volumes of the EETS, with the symbol of Alfreds jewel embossed on the front cover",
"Most of the works attributed to King Alfred or to Aelfric, along with some of those by bishop Wulfstan and much anonymous prose and verse from the pre-Conquest period, are to be found within the Society's three series",
"all of the surviving medieval drama, most of the Middle English romances, much religious and secular prose and verse including the English works of John Gower, Thomas Hoccleve and most of Caxton's prints all find their place in the publications",
"Without EETS editions, study of medieval English texts would hardly be possible."]})
text
0 Anyone who reads Old and Middle English litera...
1 Most of the works attributed to King Alfred or...
2 all of the surviving medieval drama, most of t...
3 Without EETS editions, study of medieval Engli...
そして、私が持っているリスト:
tokens = [['middl engl', 'mid-brown', 'symbol'], ["king", 'anonym', 'series'], ['mediev', 'romance', 'relig'], ['hocclev', 'edit', 'publ']]
私はほとんどを見つけようとしています上記のリストトークンの各トークン配列に適した文章。
更新:私の問題を詳細に説明するように求められました。
問題は私が英語以外のテキストでそれをやっていることです、私の問題のもう少し説明するのは非常に問題です。
私は、入力として、私のトークンリストの各要素を取得し、トークンリストの各要素のために、それはdf.text
に最も適した(おそらくいくつかのメトリックの意味での)文章を検索するいくつかの関数xを探しています。これは出力が重要ではないという主な考えです。私はちょうどそれが働くことを望む:)
また、問題についてもう少し説明し、予想される出力を追加できますか? –
文とトークンリストの間の類似性を計算し、出力文として最も類似した文のトークンリストを選択します。あるいは、各トークンリストのトークンの出現を文で数えるより簡単な方法では、トークンリストの出力としてトークンが最大に出現する文を選択します。 – mutux