Merlintxu commited on
Commit
7b06130
·
1 Parent(s): 474f9a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import streamlit as st
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
- st.success('¡Correcto!')
25
  else:
26
- st.error('Incorrecto. Intenta de nuevo.')
27
 
28
- if __name__ == "__main__":
29
- main()
 
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()