Commit
·
6e806f9
1
Parent(s):
3ec1bd2
Update app.py
Browse files
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 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|