ipvikas commited on
Commit
bf69abd
1 Parent(s): 1ac3bc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -44,7 +44,7 @@ import random
44
  import json
45
  from torch.utils.data import Dataset, DataLoader
46
 
47
- path = 'intents_tweets.json'
48
  with open(path, 'r') as f:
49
  intents = json.load(f)
50
 
@@ -144,7 +144,7 @@ warnings.filterwarnings('ignore')
144
  import json
145
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
146
 
147
- with open('intents_tweets.json', 'r') as json_data:
148
  intents = json.load(json_data)
149
 
150
  FILE = "data.pth"
@@ -206,7 +206,7 @@ def get_response(input_text):
206
  if prob.item() > 0.75:
207
  for intent in intents['intents']:
208
  if tag == intent["tag"]:
209
- return random.choice(intent['tweet_text'])#responses
210
  else:
211
  #if "From Wikipedia" in sentence:
212
  #if sentence:
 
44
  import json
45
  from torch.utils.data import Dataset, DataLoader
46
 
47
+ path = 'intents.json'
48
  with open(path, 'r') as f:
49
  intents = json.load(f)
50
 
 
144
  import json
145
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
146
 
147
+ with open('intents.json', 'r') as json_data:
148
  intents = json.load(json_data)
149
 
150
  FILE = "data.pth"
 
206
  if prob.item() > 0.75:
207
  for intent in intents['intents']:
208
  if tag == intent["tag"]:
209
+ return random.choice(intent['responses'])#responses
210
  else:
211
  #if "From Wikipedia" in sentence:
212
  #if sentence: