Spaces:
Running
Running
Gaetano Parente commited on
Commit ·
ce34350
1
Parent(s): 82f7563
fix
Browse files
modules/multilabel_classification.py
CHANGED
|
@@ -15,7 +15,6 @@ class_names = np.array(['alt.atheism', 'comp.graphics', 'comp.os.ms-windows.misc
|
|
| 15 |
'talk.politics.misc', 'talk.religion.misc'])
|
| 16 |
|
| 17 |
def predict(model_path, tokenizer_path, sentence):
|
| 18 |
-
model = models.load_model(model_path, compile=False)
|
| 19 |
tokenizer = utils.load_tokenizer(tokenizer_path)
|
| 20 |
x_data = []
|
| 21 |
x_data.append(sentence)
|
|
@@ -30,6 +29,7 @@ def predict(model_path, tokenizer_path, sentence):
|
|
| 30 |
x_t = x_pad[0]
|
| 31 |
print('x_t')
|
| 32 |
print(x_t)
|
|
|
|
| 33 |
prediction = model.predict(np.array([x_t]))
|
| 34 |
print('prediction')
|
| 35 |
print(prediction)
|
|
|
|
| 15 |
'talk.politics.misc', 'talk.religion.misc'])
|
| 16 |
|
| 17 |
def predict(model_path, tokenizer_path, sentence):
|
|
|
|
| 18 |
tokenizer = utils.load_tokenizer(tokenizer_path)
|
| 19 |
x_data = []
|
| 20 |
x_data.append(sentence)
|
|
|
|
| 29 |
x_t = x_pad[0]
|
| 30 |
print('x_t')
|
| 31 |
print(x_t)
|
| 32 |
+
model = models.load_model(model_path, compile=False)
|
| 33 |
prediction = model.predict(np.array([x_t]))
|
| 34 |
print('prediction')
|
| 35 |
print(prediction)
|