File size: 1,192 Bytes
998f4df
7dedc6b
 
 
998f4df
7dedc6b
 
998f4df
 
 
7dedc6b
5414f0f
c2bc05d
f756672
5414f0f
 
7dedc6b
998f4df
 
 
5414f0f
998f4df
 
 
 
5414f0f
126101a
5414f0f
 
 
998f4df
 
 
7dedc6b
5414f0f
7dedc6b
 
5414f0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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)