Getting error when uploading file in Rasa x using json format

[2022-04-06 07:16:52 +0000] [39769] [ERROR] Exception occurred while handling uri: 'http://localhost:5003/api/projects/default/training_examples'
Traceback (most recent call last):
  File "/home/nchoudhary/.conda/envs/rasa/lib/python3.7/site-packages/rasa/shared/utils/validation.py", line 195, in validate_training_data
    validate(json_data, schema)
  File "/home/nchoudhary/.conda/envs/rasa/lib/python3.7/site-packages/jsonschema/validators.py", line 934, in validate
    raise error
jsonschema.exceptions.ValidationError: Additional properties are not allowed ('version', 'nlu' were unexpected). Failed to validate data, make sure your data is valid. For more information about the format visit https://rasa.com/docs/rasa/training-data-format.

JSON file :

{"version": "2.0",
"nlu": [{"intent": "mood_great", "examples": ["hi"]}, 
           {"intent": "search_restaurant", "examples": ["show me Indian restaurant"]}]
}

Can you Help me with what is the proper json format that we can upload in rasa-x

Welcome to the forum :slight_smile:

As the error suggests, visit https://rasa.com/docs/rasa/training-data-format to check the training data format. It should be YAML not JSON.

1 Like

@ChrisRahme Thank you for your reply

I got the answer

As Rasa x also allows json format , so actually I was trying to upload data in json format in to Rasa-x. So the Format is given below

{
  "rasa_nlu_data": {
    "common_examples": [
      {
        "text": "hey",
        "intent": "greet"
      },
      {
        "text": "hello",
        "intent": "greet"
      },
      {
        "text": "hi",
        "intent": "greet"
      },
      {
        "text": "hello there",
        "intent": "greet"
      },
      {
        "text": "good morning",
        "intent": "greet"
      },
      {
        "text": "good evening",
        "intent": "greet"
      },
      {
        "text": "moin",
        "intent": "greet"
      },
      {
        "text": "hey there",
        "intent": "greet"
      },
      {
        "text": "let's go",
        "intent": "greet"
      },
      {
        "text": "hey dude",
        "intent": "greet"
      },
      {
        "text": "goodmorning",
        "intent": "greet"
      },
      {
        "text": "goodevening",
        "intent": "greet"
      },
      {
        "text": "good afternoon",
        "intent": "greet"
      },
      {
        "text": "good afternoon",
        "intent": "goodbye"
      },
      {
        "text": "cu",
        "intent": "goodbye"
      },
      {
        "text": "good by",
        "intent": "goodbye"
      },
      {
        "text": "cee you later",
        "intent": "goodbye"
      },
      {
        "text": "good night",
        "intent": "goodbye"
      },
      {
        "text": "bye",
        "intent": "goodbye"
      },
      {
        "text": "goodbye",
        "intent": "goodbye"
      },
      {
        "text": "have a nice day",
        "intent": "goodbye"
      },
      {
        "text": "see you around",
        "intent": "goodbye"
      },
      {
        "text": "bye bye",
        "intent": "goodbye"
      },
      {
        "text": "see you later",
        "intent": "goodbye"
      },
      {
        "text": "yes",
        "intent": "affirm"
      },
      {
        "text": "y",
        "intent": "affirm"
      },
      {
        "text": "indeed",
        "intent": "affirm"
      },
      {
        "text": "of course",
        "intent": "affirm"
      },
      {
        "text": "that sounds good",
        "intent": "affirm"
      },
      {
        "text": "correct",
        "intent": "affirm"
      },
      {
        "text": "no",
        "intent": "deny"
      },
      {
        "text": "n",
        "intent": "deny"
      },
      {
        "text": "never",
        "intent": "deny"
      },
      {
        "text": "I don't think so",
        "intent": "deny"
      },
      {
        "text": "don't like that",
        "intent": "deny"
      },
      {
        "text": "no way",
        "intent": "deny"
      },
      {
        "text": "not really",
        "intent": "deny"
      },
      {
        "text": "perfect",
        "intent": "mood_great"
      },
      {
        "text": "great",
        "intent": "mood_great"
      },
      {
        "text": "amazing",
        "intent": "mood_great"
      },
      {
        "text": "feeling like a king",
        "intent": "mood_great"
      },
      {
        "text": "wonderful",
        "intent": "mood_great"
      },
      {
        "text": "I am feeling very good",
        "intent": "mood_great"
      },
      {
        "text": "I am great",
        "intent": "mood_great"
      },
      {
        "text": "I am amazing",
        "intent": "mood_great"
      },
      {
        "text": "I am going to save the world",
        "intent": "mood_great"
      },
      {
        "text": "super stoked",
        "intent": "mood_great"
      },
      {
        "text": "extremely good",
        "intent": "mood_great"
      },
      {
        "text": "so so perfect",
        "intent": "mood_great"
      },
      {
        "text": "so good",
        "intent": "mood_great"
      },
      {
        "text": "so perfect",
        "intent": "mood_great"
      },
      {
        "text": "my day was horrible",
        "intent": "mood_unhappy"
      },
      {
        "text": "I am sad",
        "intent": "mood_unhappy"
      },
      {
        "text": "I don't feel very well",
        "intent": "mood_unhappy"
      },
      {
        "text": "I am disappointed",
        "intent": "mood_unhappy"
      },
      {
        "text": "super sad",
        "intent": "mood_unhappy"
      },
      {
        "text": "I'm so sad",
        "intent": "mood_unhappy"
      },
      {
        "text": "sad",
        "intent": "mood_unhappy"
      },
      {
        "text": "very sad",
        "intent": "mood_unhappy"
      },
      {
        "text": "unhappy",
        "intent": "mood_unhappy"
      },
      {
        "text": "not good",
        "intent": "mood_unhappy"
      },
      {
        "text": "not very good",
        "intent": "mood_unhappy"
      },
      {
        "text": "extremly sad",
        "intent": "mood_unhappy"
      },
      {
        "text": "so saad",
        "intent": "mood_unhappy"
      },
      {
        "text": "so sad",
        "intent": "mood_unhappy"
      },
      {
        "text": "are you a bot?",
        "intent": "bot_challenge"
      },
      {
        "text": "are you a human?",
        "intent": "bot_challenge"
      },
      {
        "text": "am I talking to a bot?",
        "intent": "bot_challenge"
      },
      {
        "text": "am I talking to a human?",
        "intent": "bot_challenge"
      },
      {
        "text": "show me Indian restaurant",
        "intent": "search_restaurant",
        "entities": [
          {
            "start": 8,
            "end": 14,
            "value": "Indian",
            "entity": "cuisine"
          }
        ]
      },
      {
        "text": "show me Chinese restaurant",
        "intent": "search_restaurant",
        "entities": [
          {
            "start": 8,
            "end": 15,
            "value": "Chinese",
            "entity": "cuisine"
          }
        ]
      },
      {
        "text": "show me Italian restaurant",
        "intent": "search_restaurant",
        "entities": [
          {
            "start": 8,
            "end": 15,
            "value": "Italian",
            "entity": "cuisine"
          }
        ]
      },
      {
        "text": "show me Thai restaurant",
        "intent": "search_restaurant",
        "entities": [
          {
            "start": 8,
            "end": 12,
            "value": "Thai",
            "entity": "cuisine"
          }
        ]
      }
    ],
    "regex_features": [],
    "lookup_tables": [],
    "entity_synonyms": []
  }
}

As I tried to upload the above json file, it successfully uploaded in to rasa-x and it is working fine for me

1 Like