Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
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 |
|