Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| # Use a pipeline as a high-level helper | |
| from transformers import pipeline | |
| # Cargar el modelo FinBERT | |
| pipe = pipeline("text-classification", model="ProsusAI/finbert") | |
| # T铆tulo en la p谩gina de Streamlit | |
| st.title("Clasificador de Textos Financieros con FinBERT") | |
| # Texto de ejemplo | |
| #texto = st.text_area("The company's stock price increased by 5% after the quarterly earnings report.") | |
| #texto = "The company's stock price increased by 5% after the quarterly earnings report." | |
| texto = "Put your example" | |
| st.text_input("Escribe tu prompt", texto) | |
| # Bot贸n para ejecutar la clasificaci贸n | |
| if st.button("Clasificar"): | |
| if texto: | |
| # Usar el pipeline para clasificar el texto | |
| resultado = pipe(texto) | |
| # Mostrar el resultado en la pantalla usando Streamlit | |
| st.title("Resultado de la clasificaci贸n:") | |
| st.write(resultado) | |
| #st.write("Resultado de la clasificaci贸n:") | |
| #st.write(resultado) | |
| else: | |
| st.write("Por favor, introduce un texto para clasificar.") | |
| # Usamos el pipeline para clasificar el texto | |
| #resultado = pipe(texto) | |
| # Mostramos el resultado | |
| #print(resultado) | |