-
-
Save amankharwal/859373acad0ed5d414afa52b3c182bad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open('intents.json') as file: | |
data = json.load(file) | |
training_sentences = [] | |
training_labels = [] | |
labels = [] | |
responses = [] | |
for intent in data['intents']: | |
for pattern in intent['patterns']: | |
training_sentences.append(pattern) | |
training_labels.append(intent['tag']) | |
responses.append(intent['responses']) | |
if intent['tag'] not in labels: | |
labels.append(intent['tag']) | |
num_classes = len(labels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment