Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ def summarization(text):
|
|
| 10 |
# Sentiment Classification
|
| 11 |
def sentiment_classification(summary):
|
| 12 |
sentiment_model = pipeline("text-classification", model="wxrrrrrrr/finetunde_sentiment_analysis")
|
| 13 |
-
result = sentiment_model(summary, max_length=100, truncation=True)[0]
|
| 14 |
return result
|
| 15 |
|
| 16 |
def main():
|
|
@@ -26,13 +26,12 @@ def main():
|
|
| 26 |
|
| 27 |
# Stage 2: Sentiment Classification
|
| 28 |
st.text('Analyzing sentiment...')
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
st.write("Sentiment:", sentiment)
|
| 33 |
-
st.write("Score:", score)
|
| 34 |
# Display the classification result
|
| 35 |
st.write("Sentiment:", sentiment)
|
| 36 |
|
|
|
|
| 37 |
if __name__ == '__main__':
|
| 38 |
main()
|
|
|
|
| 10 |
# Sentiment Classification
|
| 11 |
def sentiment_classification(summary):
|
| 12 |
sentiment_model = pipeline("text-classification", model="wxrrrrrrr/finetunde_sentiment_analysis")
|
| 13 |
+
result = sentiment_model(summary, max_length=100, truncation=True)[0]['label']
|
| 14 |
return result
|
| 15 |
|
| 16 |
def main():
|
|
|
|
| 26 |
|
| 27 |
# Stage 2: Sentiment Classification
|
| 28 |
st.text('Analyzing sentiment...')
|
| 29 |
+
sentiment = sentiment_classification(summary)
|
| 30 |
+
st.write(sentiment)
|
| 31 |
+
|
|
|
|
|
|
|
| 32 |
# Display the classification result
|
| 33 |
st.write("Sentiment:", sentiment)
|
| 34 |
|
| 35 |
+
|
| 36 |
if __name__ == '__main__':
|
| 37 |
main()
|