davissong01's picture
Update app.py
e1e0059
raw
history blame contribute delete
610 Bytes
import streamlit as st
from transformers import pipeline
pipe = pipeline("text-classification", model="ProsusAI/finbert")
# Prompt the user to enter financial data, each line treated as a separate string
text_input = st.text_area('Enter financial filing data (one entry per line)')
if text_input:
lines = text_input.strip().split("\n") # Split input by lines
outputs = [pipe(line) for line in lines] # Process each line with the pipeline
for line, out in zip(lines, outputs): # Display original lines and their corresponding output
st.write(f"Text: {line}")
st.json(out)