Spaces:
Sleeping
Sleeping
changes into code
Browse files
app.py
CHANGED
|
@@ -9,24 +9,29 @@ pipe = pipeline("text-classification", model="ProsusAI/finbert")
|
|
| 9 |
st.title("Clasificador de Textos Financieros con FinBERT")
|
| 10 |
|
| 11 |
# Texto de ejemplo
|
| 12 |
-
texto = st.text_area("The company's stock price increased by 5% after the quarterly earnings report.")
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Bot贸n para ejecutar la clasificaci贸n
|
| 15 |
if st.button("Clasificar"):
|
| 16 |
if texto:
|
|
|
|
| 17 |
# Usar el pipeline para clasificar el texto
|
| 18 |
resultado = pipe(texto)
|
| 19 |
|
| 20 |
# Mostrar el resultado en la pantalla usando Streamlit
|
| 21 |
-
st.
|
| 22 |
-
st.
|
|
|
|
|
|
|
|
|
|
| 23 |
else:
|
| 24 |
st.write("Por favor, introduce un texto para clasificar.")
|
| 25 |
|
| 26 |
-
'''
|
| 27 |
# Usamos el pipeline para clasificar el texto
|
| 28 |
-
resultado = pipe(texto)
|
| 29 |
|
| 30 |
# Mostramos el resultado
|
| 31 |
-
print(resultado)
|
| 32 |
-
'''
|
|
|
|
| 9 |
st.title("Clasificador de Textos Financieros con FinBERT")
|
| 10 |
|
| 11 |
# Texto de ejemplo
|
| 12 |
+
#texto = st.text_area("The company's stock price increased by 5% after the quarterly earnings report.")
|
| 13 |
+
texto = "The company's stock price increased by 5% after the quarterly earnings report."
|
| 14 |
+
|
| 15 |
+
st.text_input("Escribe tu prompt", texto)
|
| 16 |
|
| 17 |
# Bot贸n para ejecutar la clasificaci贸n
|
| 18 |
if st.button("Clasificar"):
|
| 19 |
if texto:
|
| 20 |
+
|
| 21 |
# Usar el pipeline para clasificar el texto
|
| 22 |
resultado = pipe(texto)
|
| 23 |
|
| 24 |
# Mostrar el resultado en la pantalla usando Streamlit
|
| 25 |
+
st.title("Resultado de la clasificaci贸n:")
|
| 26 |
+
st.text_area(resultado)
|
| 27 |
+
|
| 28 |
+
#st.write("Resultado de la clasificaci贸n:")
|
| 29 |
+
#st.write(resultado)
|
| 30 |
else:
|
| 31 |
st.write("Por favor, introduce un texto para clasificar.")
|
| 32 |
|
|
|
|
| 33 |
# Usamos el pipeline para clasificar el texto
|
| 34 |
+
#resultado = pipe(texto)
|
| 35 |
|
| 36 |
# Mostramos el resultado
|
| 37 |
+
#print(resultado)
|
|
|