Explore Courses Blog Tutorials Interview Questions
0 votes
in Python by (19.9k points)

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"))


    model_directory = trainer.persist('models/')

return model_directory


Error :

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

1 Answer

0 votes
by (25.1k points)

Your code seems to be fine maybe your data file. You need to check the encoding of the file. Open your testData.json file in notepad and save it with ANSI encoding.

Browse Categories