Spaces:
Runtime error
Runtime error
Commit ·
10a26d2
1
Parent(s): abef4a0
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,8 +33,7 @@ with open('id_to_category.pkl', 'rb') as fp:
|
|
| 33 |
id_to_category = pickle.load(fp)
|
| 34 |
|
| 35 |
def text_classifier(text):
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
return(id_to_category[np.argmax(pred)])
|
| 39 |
|
| 40 |
iface= gr.Interface(fn=text_classifier, inputs="text", outputs="text").launch()
|
|
|
|
| 33 |
id_to_category = pickle.load(fp)
|
| 34 |
|
| 35 |
def text_classifier(text):
|
| 36 |
+
pred=end_to_end_model.predict([text])
|
| 37 |
+
return(id_to_category[np.argmax(pred)])
|
|
|
|
| 38 |
|
| 39 |
iface= gr.Interface(fn=text_classifier, inputs="text", outputs="text").launch()
|