File size: 665 Bytes
ca99a2f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import streamlit as st
from transformers import pipeline

# model=ProsusAI/finbert
pipe = pipeline("text-classification", model="distilbert-base-uncased-finetuned-sst-2-english")

# 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)