Spaces:
Runtime error
Runtime error
Commit ·
f6b73e1
1
Parent(s): d3b17c2
Delete analysis_sentiment.py
Browse files- analysis_sentiment.py +0 -17
analysis_sentiment.py
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 1 |
-
import tensorflow as tf
|
| 2 |
-
import gradio as gr
|
| 3 |
-
|
| 4 |
-
def frase(Frase):
|
| 5 |
-
modelo = tf.keras.models.load_model("model_experiments_spanish/model_nlp_spanish_2")
|
| 6 |
-
#modelo.summary()
|
| 7 |
-
classes = ['alegría', 'amor', 'enojo', 'miedo', 'sorpresa', 'tristeza']
|
| 8 |
-
#sentences = [input("Ingrese frase:")]
|
| 9 |
-
modelo_preds = modelo.predict([Frase])
|
| 10 |
-
#print(modelo_preds)
|
| 11 |
-
print(f"The sentences contains: {classes[tf.argmax(tf.squeeze(modelo_preds))]}")
|
| 12 |
-
clas = classes[tf.argmax(tf.squeeze(modelo_preds))]
|
| 13 |
-
return clas
|
| 14 |
-
interface = gr.Interface(fn=frase,inputs='text',outputs='text')
|
| 15 |
-
interface.launch(inplace=False)
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|