while training using rasa nlu ValueError: Unknown data format for file x.json

╄→尐↘猪︶ㄣ 提交于 2020-12-31 15:02:40

问题


I'm training a json file data for intent classification using rasa nlu. When I am doing the training with any .md file it is working but when I tried with .json file it is showing error.

I tried to validate the json file it is in correct format.

from rasa_nlu.training_data import load_data
from rasa_nlu.model import Trainer
from rasa_nlu import config
from rasa_nlu.model import Interpreter


def train_rasa(file_path):
    training_data = load_data(file_path)
    trainer = Trainer(config.load("config.yml"))
    trainer.train(training_data)
    model_directory = trainer.persist('models/')
return model_directory

train_rasa('data/testData.json')

Error :

ValueError: Unknown data format for file 'data/testData.json

回答1:


I got the solution. So when i checked i found out that my data.json file was in utf-8 fromat which is causing problem so i changed the encoding to ANSI in notepad which worked out.



来源:https://stackoverflow.com/questions/56964918/while-training-using-rasa-nlu-valueerror-unknown-data-format-for-file-x-json

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!