Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import
|
| 2 |
import spacy
|
| 3 |
|
| 4 |
nlp = spacy.load('es_core_news_sm')
|
|
@@ -15,15 +15,12 @@ def game_logic(sentence, user_input):
|
|
| 15 |
else:
|
| 16 |
return False
|
| 17 |
|
| 18 |
-
def main():
|
| 19 |
-
st.title('Juego de gramática española')
|
| 20 |
-
sentence = st.text_input('Introduce una frase:')
|
| 21 |
-
user_input = st.text_input('Identifica una palabra en la frase:')
|
| 22 |
if sentence and user_input:
|
| 23 |
if game_logic(sentence, user_input):
|
| 24 |
-
|
| 25 |
else:
|
| 26 |
-
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
import spacy
|
| 3 |
|
| 4 |
nlp = spacy.load('es_core_news_sm')
|
|
|
|
| 15 |
else:
|
| 16 |
return False
|
| 17 |
|
| 18 |
+
def main(sentence, user_input):
|
|
|
|
|
|
|
|
|
|
| 19 |
if sentence and user_input:
|
| 20 |
if game_logic(sentence, user_input):
|
| 21 |
+
return '¡Correcto!'
|
| 22 |
else:
|
| 23 |
+
return 'Incorrecto. Intenta de nuevo.'
|
| 24 |
|
| 25 |
+
iface = gr.Interface(fn=main, inputs=["text", "text"], outputs="text")
|
| 26 |
+
iface.launch()
|