gpt4 book ai didi

elasticsearch - LM在 Elasticsearch 中

转载 作者:行者123 更新时间:2023-12-03 01:13:54 25 4
gpt4 key购买 nike

如何改善这种情况的召回率?有什么建议吗?
我想创建一个索引,其中包含3900万个段落,每个段落至少包含四个英语句子。我的询问是简短而疑问的句子。我知 Prop 有Dirichlet平滑,停用词删除和词干分析功能的语言模型最适合这种情况。如何在这些条件下建立索引(我已使用此配置建立索引,但默认bm25的结果没有差异)
我的索引:

{
"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代码是:
query = " (" + prevTurn + ")^1 (" + currentTurn + ")^2"

search_param={
"query": {
"query_string": {
"query":query,
"analyzer": "my_stop_analyzer",
"default_field":"doc.content"
}
}
}
一个示例转弯:
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?

最佳答案

您可以在查询中尝试相似

关于elasticsearch - LM在 Elasticsearch 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63316759/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com