Update app.py
Browse files
app.py
CHANGED
|
@@ -1,27 +1,23 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
uploaded_file = st.file_uploader("Upload CSV File", type="csv")
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
# Display the processed data or perform further actions
|
| 13 |
-
st.write(processed_data)
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
trans = tras_sum(uploaded_file.name)
|
| 18 |
-
st.write(trans)
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Load the summarization & translation model pipeline
|
| 5 |
+
tran_sum_pipe = pipeline("translation", model='utrobinmv/t5_summary_en_ru_zh_base_2048')
|
| 6 |
+
sentiment_pipeline = pipeline("text-classification", model="Howosn/Sentiment_Model")
|
|
|
|
| 7 |
|
| 8 |
+
# Streamlit application title
|
| 9 |
+
st.title("Emotion analysis")
|
| 10 |
+
st.write("Turn Your Input Into Sentiment Score")
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
# Text input for the user to enter the text to analyse
|
| 13 |
+
text = st.text_area("Enter the text", "")
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
# Perform analysis result when the user clicks the "Analyse" button
|
| 16 |
+
if st.button("Analyse"):
|
| 17 |
+
# Perform text classification on the input text
|
| 18 |
+
trans_sum = tran_sum_pipe(text)
|
| 19 |
+
result = sentiment_pipeline(trans_sum)
|
| 20 |
+
|
| 21 |
+
# Display the analysis result
|
| 22 |
+
st.write("Text:", text)
|
| 23 |
+
st.write("result:", result)
|