gpt4 book ai didi

python - 在架构 'required' 中验证 ['properties' 失败] ['rasa_nlu_data' ] ['properties' ] ['common_examples' ] ['items' ] ['properties' ] ['entities' 1010 ] 0x1010456767

转载 作者:行者123 更新时间:2023-12-03 09:08:08 29 4
gpt4 key购买 nike

在运行 python 文件以使用 rasa nlu 训练文件时,我在命令提示符下收到此错误

我目前正在使用 Windows 10
rasa_core==0.8.2
rasa_nlu==0.11.4
python 3.6.7
PS:我将 rasa 和 python 都降级了,因为 rasa 最近版本中的模块名称发生了变化,而 python 3.8 分别不支持 rasa。

我对编码比较陌生。我很想在这里得到一些帮助。

**Traceback (most recent call last):

File "nlu_model.py", line 12, in <module>

train_nlu('./data/data.json', 'config_spacy.json', './models/nlu')

File "nlu_model.py", line 6, in train_nlu

training_data = load_data(data)

File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_nlu\converters.py", line 365, in load_data

return load_rasa_data(files)

File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_nlu\converters.py", line 267, in load_rasa_data

validate_rasa_nlu_data(data)

File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_nlu\converters.py", line 253, in validate_rasa_nlu_data

raise error

File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\rasa_nlu\converters.py", line 248, in validate_rasa_nlu_data

validate(data, rasa_nlu_data_schema())

File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\jsonschema\validators.py", line 541, in validate

cls(schema, *args, **kwargs).validate(instance)

File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\jsonschema\validators.py", line 130, in validate

raise error

jsonschema.exceptions.ValidationError: 'start' is a required property. Failed to validate training data, make sure your data is valid. For more information about the format visit https://rasahq.github.io/rasa_nlu/dataformat.html

Failed validating 'required' in schema['properties']['rasa_nlu_data']['properties']['common_examples']['items']['properties']['entities']['items']:
{'properties': {'end': {'type': 'number'},
'entity': {'type': 'string'},
'start': {'type': 'number'},
'value': {'type': 'semphasized texttring'}},
'required': ['start', 'end', 'entity'],**strong text**
'type': 'object'}

On instance['rasa_nlu_data']['common_examples'][3]['entities'][1]:
{'entities': [], 'intent': 'goodbye', 'text': 'Thank you for your help'}**

最佳答案

看起来你使用的是相当过时的 Rasa 版本,1.0 之前的事件
最新版本是 1.7.0

您可以找到升级说明 here

您可以尝试升级 Rasa 并重试吗?

关于python - 在架构 'required' 中验证 ['properties' 失败] ['rasa_nlu_data' ] ['properties' ] ['common_examples' ] ['items' ] ['properties' ] ['entities' 1010 ] 0x1010456767,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59738939/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com