如何解决是否可以从 ElasticSearch 获得文本相似度分数?
有没有办法从 ES 索引中获得文本相似度分数而不是相关性分数? 我正在阅读 ES 默认的 BM25 评分算法(无法将 BM25 评分标准化为 -1;1、0-100 等),所以我尝试使用 shingle 算法:
{
"settings":{
"analysis":{
"analyzer":{
"my_custom_analyzer":{
"type":"custom","tokenizer":"standard","char_filter":[
"html_strip"
],"filter":[
"lowercase","asciifolding","decimal_digit","en_stop","en_stem","shingle"
]
}
},"filter":{
"en_stop":{
"type":"stop","stopwords":"_english_","ignore_case":true
},"en_stem":{
"type":"snowball","language":"english"
},"shingle": {
"type": "shingle","min_shingle_size": 2,"max_shingle_size": 3
}
}
}
},"mappings": {
"properties": {
"content": {
"type": "text","analyzer": "my_custom_analyzer"
}
}
}
}
但是 ES 仍然给出了大于 100 的分数。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。