Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
|
|
4 |
# Summarization
|
5 |
def summarization(text):
|
6 |
-
text_model = pipeline("
|
7 |
-
summary = text_model(text, max_length=100, temperature=1.0)[0]
|
8 |
-
return summary
|
9 |
|
|
|
10 |
# Sentiment Classification
|
11 |
def sentiment_classification(summary):
|
12 |
sentiment_model = pipeline("text-classification", model="wxrrrrrrr/finetunde_sentiment_analysis")
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
|
5 |
# Summarization
|
6 |
def summarization(text):
|
7 |
+
text_model = pipeline("text-generation", model="ainize/bart-base-cnn")
|
8 |
+
summary = text_model(text, max_length=100, temperature=1.0, return_full_text=False)[0]
|
9 |
+
return {"generated_text": summary["generated_text"]}
|
10 |
|
11 |
+
|
12 |
# Sentiment Classification
|
13 |
def sentiment_classification(summary):
|
14 |
sentiment_model = pipeline("text-classification", model="wxrrrrrrr/finetunde_sentiment_analysis")
|