我的模型找不到任何实体
My model can't find any entities
我正在测试 NLP 工具,现在我遇到了 Rasa NLU 的问题。
使用 API.AI、Wit.ai 和 LUIS.AI 我可以通过不超过 8-10 个示例找到我想要的实体。另一方面,对于 Rasa,我已经有 18 个示例,但我永远找不到实体。即使我的查询与我的示例之一完全匹配,结果仍然是一个空的实体数组。
我将 Rasa 与推荐的 Docker 实例一起使用,我当前的管道是 ["nlp_spacy", "tokenizer_spacy", "intent_featurizer_spacy", "ner_crf", "ner_synonyms", "intent_classifier_sklearn" and "ner_duckling"]
。
我在查询中指定我的项目和模型,如下所示:
localhost:5000/parse?q=my_sentence&project=my_project&model=my_model
如有任何有用的信息,我们将不胜感激。
谢谢!
更新示例
{
"text": "How can I make a carrot cake?",
"intent": "AskRecipe",
"entities": [
{
"start": 17,
"end": 27,
"value": "carrot cake",
"entity": "recipe"
}
]
},
{
"text": "What do I need to make a Lemon Pie?",
"intent": "AskRecipe",
"entities": [
{
"start": 25,
"end": 33,
"value": "Lemon Pie",
"entity": "recipe"
}
]
},
{
"text": "What do I need to make brownies?",
"intent": "AskRecipe",
"entities": [
{
"start": 23,
"end": 30,
"value": "brownies",
"entity": "recipe"
}
]
}
然后,例如,当我尝试从“我需要什么来制作核仁巧克力饼?”中提取信息时。 (也作为示例列出)这是结果:
{"entities": [], "intent": {"confidence": 0.8870822891508189, "name": "AskRecipe"}, "text": "What do I need to make brownies?", "intent_ranking": [{"confidence": 0.8870822891508189, "name": "AskRecipe"}, {"confidence": 0.11291771084918109, "name": "greet"}]}
我尝试了很多其他示例,但 none 个有效。
我解决了这个问题。
在我的 config.json 文件中,我将管道值更新为 "scapy_sklearn"
而不是 ["nlp_spacy", "tokenizer_spacy", "intent_featurizer_spacy", "ner_crf", "ner_synonyms", "intent_classifier_sklearn" and "ner_duckling"]
。
此外,我在训练新模型后重新启动了 docker 实例。
不过,我必须说,我成功使用的 docker 实例与我发布此问题时使用的实例不同,所以老实说,我不能 100% 确定我之前没有破坏任何配置 - 虽然我相信我没有。
我希望这对某人有所帮助:)
我遇到了 Rasa 无法识别实体的相同问题。我看到你以不同的方式解决了这个问题,我将添加对我有用的方法,因为我在发布的示例中看到了我犯的同样的错误 -
最终值必须是 ('start' index) + (length of 'value')
,所以它应该是此处显示的每个 'end' 值 +1。
我知道这很简单,但对我有用。
我正在测试 NLP 工具,现在我遇到了 Rasa NLU 的问题。
使用 API.AI、Wit.ai 和 LUIS.AI 我可以通过不超过 8-10 个示例找到我想要的实体。另一方面,对于 Rasa,我已经有 18 个示例,但我永远找不到实体。即使我的查询与我的示例之一完全匹配,结果仍然是一个空的实体数组。
我将 Rasa 与推荐的 Docker 实例一起使用,我当前的管道是 ["nlp_spacy", "tokenizer_spacy", "intent_featurizer_spacy", "ner_crf", "ner_synonyms", "intent_classifier_sklearn" and "ner_duckling"]
。
我在查询中指定我的项目和模型,如下所示:
localhost:5000/parse?q=my_sentence&project=my_project&model=my_model
如有任何有用的信息,我们将不胜感激。 谢谢!
更新示例
{
"text": "How can I make a carrot cake?",
"intent": "AskRecipe",
"entities": [
{
"start": 17,
"end": 27,
"value": "carrot cake",
"entity": "recipe"
}
]
},
{
"text": "What do I need to make a Lemon Pie?",
"intent": "AskRecipe",
"entities": [
{
"start": 25,
"end": 33,
"value": "Lemon Pie",
"entity": "recipe"
}
]
},
{
"text": "What do I need to make brownies?",
"intent": "AskRecipe",
"entities": [
{
"start": 23,
"end": 30,
"value": "brownies",
"entity": "recipe"
}
]
}
然后,例如,当我尝试从“我需要什么来制作核仁巧克力饼?”中提取信息时。 (也作为示例列出)这是结果:
{"entities": [], "intent": {"confidence": 0.8870822891508189, "name": "AskRecipe"}, "text": "What do I need to make brownies?", "intent_ranking": [{"confidence": 0.8870822891508189, "name": "AskRecipe"}, {"confidence": 0.11291771084918109, "name": "greet"}]}
我尝试了很多其他示例,但 none 个有效。
我解决了这个问题。
在我的 config.json 文件中,我将管道值更新为 "scapy_sklearn"
而不是 ["nlp_spacy", "tokenizer_spacy", "intent_featurizer_spacy", "ner_crf", "ner_synonyms", "intent_classifier_sklearn" and "ner_duckling"]
。
此外,我在训练新模型后重新启动了 docker 实例。
不过,我必须说,我成功使用的 docker 实例与我发布此问题时使用的实例不同,所以老实说,我不能 100% 确定我之前没有破坏任何配置 - 虽然我相信我没有。
我希望这对某人有所帮助:)
我遇到了 Rasa 无法识别实体的相同问题。我看到你以不同的方式解决了这个问题,我将添加对我有用的方法,因为我在发布的示例中看到了我犯的同样的错误 -
最终值必须是 ('start' index) + (length of 'value')
,所以它应该是此处显示的每个 'end' 值 +1。
我知道这很简单,但对我有用。