Nlp 查找表在Rasa NLU的训练数据中不起作用
我有一个特定意图的例子,也展示了实体,我希望模型能够识别其他单词,它们可能是该特定意图的实体,但它无法识别它Nlp 查找表在Rasa NLU的训练数据中不起作用,nlp,markdown,rasa-nlu,Nlp,Markdown,Rasa Nlu,我有一个特定意图的例子,也展示了实体,我希望模型能够识别其他单词,它们可能是该特定意图的实体,但它无法识别它 ## 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) frequenc
## 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?'}
但是当我输入文本“价格的频率是多少?”时,我得到了输出
{'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?'}
根据RasaNLU文档,为了使查找工作正常,您需要包含查找表中的一些示例 此外,您需要了解“phone type”和“region”是不同的模式,因为“phone type”有两个单词,“region”是一个单词。记住这一点,我将您的数据集扩展为
## 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"
}
]
}
我建议使用它来生成简单的数据集,这将使您更容易,并自动生成同义词等
另外,万一您不知道,您也可以使用文件来指向大型查找,例如
## lookup:city
data/lookups/city_lookup.txt
在config.yml中使用以下管道 管道:
- 名称:WhitespaceTokenizer
- 名称:RegexFeatureizer
- 名称:CRFEntityExtractor
- 名称:LexicalSyntacticFeaturer
- 名称:CountVectorsFeaturizer
- 名称:CountVectorsFeaturizer 分析器:“char_wb” 最小内存:1 最大内存:4
- 姓名:DIETClassifier 实体识别:错误 纪元:100
- 名称:EntitySynonymMapper
- 姓名:响应选择器 纪元:100