首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >弹性搜索LM

弹性搜索LM
EN

Stack Overflow用户
提问于 2020-08-08 14:53:56
回答 1查看 133关注 0票数 0

如何提高对这种情况的回忆?有什么建议吗?我想要建立一个索引,每一篇都包含至少四个英语句子。我的问题是简短的疑问句。我知道,在这种情况下,使用Dirichlet平滑、停止字删除和词干分析器的语言模型是最好的。我如何用这些条件进行索引(我已经用这些信息进行了索引,但是与默认的bm25结果没有差别)

My索引:

代码语言:javascript
复制
{
"settings": {
"index":{
            "similarity" : {
          "my_similarity" : {
            "type" : "LMDirichlet",
            "mu" : 2000
          }
        },
  "analysis":{
    "filter":{
      "english_stop":{
        "type":"stop",
        "stopwords":"_english_"
      },
      "my_stemmer":{
        "type":"stemmer",
        "name":"english"
      }
    },
    "analyzer":{
      "my_custom_analyzer":{
        "type":"custom",
        "tokenizer":"standard",
        "filter":[
          "lowercase",
          "english_stop",
          "my_stemmer"
          ]
      }
    }
  }
},
    "number_of_shards": 1
},
"mappings": {
    "properties": {
        "content": {
        "similarity" : "my_similarity" ,
        "analyzer": "my_custom_analyzer",
            "type": "text"
        }
    }
}
}

和搜索我的python代码的方法是:

代码语言:javascript
复制
query = " (" + prevTurn + ")^1 (" + currentTurn + ")^2"

search_param={
"query": {
"query_string": {
"query":query,
"analyzer": "my_stop_analyzer",
"default_field":"doc.content"
}
}
}

一个示例转弯:

代码语言:javascript
复制
Title: The Neolithic Revolution
Description: The neolithic revolution and technology used within it and when it emerged in the british isles.  Also, the transition to the bronze age and its significance.
1   What was the neolithic revolution?
2   When did it start and end?
3   Why did it start?
4   What did the neolithic invent?
5   What tools were used?
6   When was it brought to the british isles?
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-08-10 09:01:19

您可以在查询中尝试相似性。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63316759

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档