davissong01 commited on
Commit
6e806f9
·
1 Parent(s): 3ec1bd2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -2,8 +2,14 @@ import streamlit as st
2
  from transformers import pipeline
3
 
4
  pipe = pipeline("text-classification", model="ProsusAI/finbert")
5
- text = st.text_area('enter some financial filing data!')
6
 
7
- if text:
8
- out = pipe(text)
9
- st.json(out)
 
 
 
 
 
 
 
 
2
  from transformers import pipeline
3
 
4
  pipe = pipeline("text-classification", model="ProsusAI/finbert")
 
5
 
6
+ # Prompt the user to enter financial data, each line treated as a separate string
7
+ text_input = st.text_area('Enter financial filing data (one entry per line)')
8
+
9
+ if text_input:
10
+ lines = text_input.strip().split("\n") # Split input by lines
11
+ outputs = [pipe(line) for line in lines] # Process each line with the pipeline
12
+
13
+ for line, out in zip(lines, outputs): # Display original lines and their corresponding output
14
+ st.write(f"Text: {line}")
15
+ st.json(out)