chap0lin commited on
Commit
5006386
1 Parent(s): 6c004f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -7,6 +7,7 @@ from keras import backend as K
7
  import requests
8
  import shutil
9
  import requests
 
10
 
11
  def recall_m(y_true, y_pred):
12
  true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
@@ -55,9 +56,10 @@ reconstructed_model_CNN = keras.models.load_model("best weights CNN.h5",
55
 
56
 
57
  def greet(sentence):
 
58
 
59
  aux_vector = []
60
- for word in sentence:
61
  aux_vector.append(reloaded_w2v_model.wv[word])
62
  MCTIinput_vector = pad_sequences(aux_vector, maxlen=2726, padding='pre')
63
 
 
7
  import requests
8
  import shutil
9
  import requests
10
+ import json
11
 
12
  def recall_m(y_true, y_pred):
13
  true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
 
56
 
57
 
58
  def greet(sentence):
59
+ sentenceWords = json.loads(sentence)
60
 
61
  aux_vector = []
62
+ for word in sentenceWords:
63
  aux_vector.append(reloaded_w2v_model.wv[word])
64
  MCTIinput_vector = pad_sequences(aux_vector, maxlen=2726, padding='pre')
65