私はelasticsearchに次のIDを持つ文書を持っています:AVosj8FEIaetdb3CXpP-
私はそれをtf-idfのフィールドのすべての単語にアクセスしようとしています:私が持っているElasticsearch:指定された文書のすべての用語のtf-idfを取得する
GET /cnn/cnn_article/AVosj8FEIaetdb3CXpP-/_termvectors
{
"fields" : ["author_wording"],
"term_statistics" : true,
"field_statistics" : true
}'
応答は次のとおりです。
{
"_index": "dailystormer",
"_type": "dailystormer_article",
"_id": "AVosj8FEIaetdb3CXpP-",
"_version": 3,
"found": true,
"took": 1,
"term_vectors": {
"author_wording": {
"field_statistics": {
"sum_doc_freq": 3408583,
"doc_count": 16111,
"sum_ttf": 7851321
},
"terms": {
"318": {
"doc_freq": 4,
"ttf": 4,
"term_freq": 1,
"tokens": [
{
"position": 121,
"start_offset": 688,
"end_offset": 691
}
]
},
"742": {
"doc_freq": 1,
"ttf": 1,
"term_freq": 1,
"tokens": [
{
"position": 122,
"start_offset": 692,
"end_offset": 695
}
]
},
"9971": {
"doc_freq": 1,
"ttf": 1,
"term_freq": 1,
"tokens": [
{
"position": 123,
"start_offset": 696,
"end_offset": 700
}
]
},
"a": {
"doc_freq": 14921,
"ttf": 163268,
"term_freq": 11,
"tokens": [
{
"position": 1,
"start_offset": 13,
"end_offset": 14
},
...
"you’re": {
"doc_freq": 1112,
"ttf": 1647,
"term_freq": 1,
"tokens": [
{
"position": 80,
"start_offset": 471,
"end_offset": 477
}
]
}
}
}
}
}
それは私の用語頻度(TF)ではなく、TF-IDFのようないくつかの興味深いのフィールドを返します。私はそれを自分で再計算すべきですか?それは良いアイデアですか?どうすればいいですか?
このクエリで回答を表示できますか? – Mysterion
@Mysterion私は自分の答えを更新しました – mel