Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,12 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
# txt2Story
|
| 7 |
def text_summarize(text):
|
| 8 |
pipe = pipeline("summarization", model="human-centered-summarization/financial-summarization-pegasus")
|
| 9 |
summary = pipe(text)[0]['summary_text']
|
| 10 |
print(summary)
|
| 11 |
return summary
|
| 12 |
|
| 13 |
-
# Story2Audio
|
| 14 |
def sentiment(summary):
|
| 15 |
pipe = pipeline("text-classification", model="WillWEI0103/CustomModel_finance_sentiment_analytics")
|
| 16 |
label = pipe(summary)[0]['label']
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
|
|
|
|
|
|
|
|
|
| 4 |
def text_summarize(text):
|
| 5 |
pipe = pipeline("summarization", model="human-centered-summarization/financial-summarization-pegasus")
|
| 6 |
summary = pipe(text)[0]['summary_text']
|
| 7 |
print(summary)
|
| 8 |
return summary
|
| 9 |
|
|
|
|
| 10 |
def sentiment(summary):
|
| 11 |
pipe = pipeline("text-classification", model="WillWEI0103/CustomModel_finance_sentiment_analytics")
|
| 12 |
label = pipe(summary)[0]['label']
|