Python 使用rasa nlu VALUERROR进行培训时:未知文件x.json的数据格式

Python 使用rasa nlu VALUERROR进行培训时:未知文件x.json的数据格式,python,runtime-error,rasa-nlu,Python,Runtime Error,Rasa Nlu,我正在培训一个json文件数据,以便使用rasa nlu进行意图分类。当我使用任何.md文件进行培训时,它都会工作,但当我尝试使用.json文件时,它会显示错误 我试图验证json文件的格式是否正确 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 d

我正在培训一个json文件数据,以便使用rasa nlu进行意图分类。当我使用任何.md文件进行培训时,它都会工作,但当我尝试使用.json文件时,它会显示错误

我试图验证json文件的格式是否正确

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')
错误:


我找到了解决办法。因此,当我检查时,我发现我的data.json文件位于导致问题的
utf-8
fromat中,因此我在记事本中将编码更改为
ANSI
,这就解决了问题

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