我有一个特定意图的示例,该示例也显示了该实体,并且我希望模型识别可能是该特定意图的实体的其他单词,但它无法识别它。
## intent: frequency
* what is the frequency of [region](field)?
* what's the frequency of[region](field)?
* frequency of [region](field)?
* [region](field)s frequency?
* [region](field) frequency?
* frequency [region](field)?
## lookup: field
* price
* phone type
* region
因此,当我输入文本“区域的频率是多少?”我得到了输出
{'intent': {'name': 'frequency', 'confidence': 0.9517087936401367},
'entities': [{'start': 17, 'end': 23, 'value': 'region',
'entity': 'field', 'confidence': 0.9427971487440825,
'extractor': 'CRFEntityExtractor'}], 'text': 'What is the frequency of region?'}
但是当我输入文字“价格的频率是多少?”我得到了输出
{'intent': {'name': 'frequency', 'confidence': 0.9276150465011597},
'entities': [], 'text': 'What is the frequency of price?'}
答案 0 :(得分:1)
根据RasaNLU文档,为了使查找工作正常运行,您需要在查找表中包括一些示例。
此外,您还需要了解“电话类型”和“区域”是不同的模式,因为“电话类型”有两个词,而“区域”是一个词。请记住,我将您的数据集扩展为
## intent: frequency
* what is the frequency of [region](field)?
* what is the frequency of [city](field)?
* what is the frequency of [work](field)?
* what's the frequency of [phone type](field)?
* what is the frequency of [phone type](field)?
* frequency of [region](field)?
* frequency of [phone type](field)?
* [region](field)s frequency?
* [region](field) frequency?
* frequency [region](field)?
现在,当我尝试您提到的所有示例时,即使“价格”未包含在数据集中,但所有模式均已涵盖,它们仍然起作用。
Enter a message: What is the frequency of price?
{
"intent": {
"name": "frequency",
"confidence": 0.966820478439331
},
"entities": [
{
"start": 25,
"end": 30,
"value": "price",
"entity": "field",
"confidence": 0.7227365687405007,
"extractor": "CRFEntityExtractor"
}
]
}
我建议使用https://github.com/rodrigopivi/Chatito生成简单的数据集,这将使您更轻松并自动生成同义词等。
此外,以防万一您不知道还可以使用文件来指向大型查询,例如
## lookup:city
data/lookups/city_lookup.txt
答案 1 :(得分:0)
在config.yml中使用以下管道
管道: