elasticsearch - Elasticsearch 错误语言检测
问题描述
我正在使用 Elasticsearch 的默认语言识别模型(lang_ident_model_1)。
我遇到了阿拉伯语和英语检测的问题。
使用版本 7.13.2,使用 curl 发送请求到GET _ingest/pipeline/_simulate
.
这被错误地识别为 SV(瑞典语)。
要求:
"pipeline": {
"processors": [
{
"inference": {
"model_id": "lang_ident_model_1"
}
}
]
},
"docs": [
{
"_source": {
"text": "CNN تتجه أمريكا إلى أفضل الأوقات ، وأسوأ الأوقات في الصيف ، حيث يخفف الوعد الذي طال انتظاره "
}
}
]
}
回复:
{
"docs": [
{
"doc": {
"_index": "_index",
"_type": "_doc",
"_id": "_id",
"_source": {
"text": "CNN تتجه أمريكا إلى أفضل الأوقات ، وأسوأ الأوقات في الصيف ، حيث يخفف الوعد الذي طال انتظاره ",
"ml": {
"inference": {
"prediction_score": 0.9711386959542202,
"model_id": "lang_ident_model_1",
"prediction_probability": 0.9711386959542202,
"predicted_value": "sv"
}
}
},
"_ingest": {
"timestamp": "2021-06-30T08:25:00.959013809Z"
}
}
}
]
}
这被正确识别为 AR(阿拉伯语)。
要求:
{
"pipeline": {
"processors": [
{
"inference": {
"model_id": "lang_ident_model_1"
}
}
]
},
"docs": [
{
"_source": {
"text": "تتجه أمريكا إلى أفضل الأوقات ، وأسوأ الأوقات في الصيف ، حيث يخفف الوعد الذي طال انتظاره "
}
}
]
}
回复:
{
"docs": [
{
"doc": {
"_index": "_index",
"_type": "_doc",
"_id": "_id",
"_source": {
"text": "تتجه أمريكا إلى أفضل الأوقات ، وأسوأ الأوقات في الصيف ، حيث يخفف الوعد الذي طال انتظاره ",
"ml": {
"inference": {
"prediction_score": 0.9999964083151712,
"model_id": "lang_ident_model_1",
"prediction_probability": 0.9999964083151712,
"predicted_value": "ar"
}
}
},
"_ingest": {
"timestamp": "2021-06-30T08:25:36.663997653Z"
}
}
}
]
}
以拉丁字母开头的阿拉伯文本似乎存在问题。
这被错误地识别为 MG(马达加斯加语)
要求:
{
"pipeline": {
"processors": [
{
"inference": {
"model_id": "lang_ident_model_1"
}
}
]
},
"docs": [
{
"_source": {
"text": "I am so happy today, I am also so sad today"
}
}
]
}
回应:
{
"docs": [
{
"doc": {
"_index": "_index",
"_type": "_doc",
"_id": "_id",
"_source": {
"text": "I am so happy today, I am also so sad today",
"ml": {
"inference": {
"prediction_score": 0.9639440826428515,
"model_id": "lang_ident_model_1",
"prediction_probability": 0.9639440826428515,
"predicted_value": "mg"
}
}
},
"_ingest": {
"timestamp": "2021-06-30T08:52:17.64136234Z"
}
}
}
]
}
解决方案
推荐阅读
- html - 响应式 CSS 导航栏来自底部。-100% 不删除
- dart - 使用 Dart 零安全性进行延迟加载
- linux - 修改页表读/写位以修改系统调用表
- postgresql - 使用西班牙语词典 to_tsquery 的 PostgreSQL 全文搜索在某些单词中不起作用
- java - Spring WebClient,并行调用同一服务,收集成功和错误以进行响应
- reactjs - 如何根据角色在反应路由器v5中设置默认登录页面
- javascript - Javascript验证器表单通用?
- javascript - Bootstrap 5 警报未显示
- node.js - 如何在 Dust.js 中单独保留未定义的字段?
- python - 在 macOS 上使用 YOLO v3:OpenCV 不编译