File size: 812 Bytes
cfb5fed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import streamlit as st
from transformers import pipeline

# Load the summarization & translation model pipeline
tran_sum_pipe = pipeline("translation", model='utrobinmv/t5_summary_en_ru_zh_base_2048')
sentiment_pipeline = pipeline("text-classification", model="Howosn/Sentiment_Model")

# Streamlit application title
st.title("Emotion analysis")
st.write("Turn Your Input Into Sentiment Score")

# Text input for the user to enter the text to analyze
text = st.text_area("Enter the text", "")

# Perform analysis result when the user clicks the "Analyse" button
if st.button("Analyse"):
    # Perform text classification on the input text
    trans_sum = tran_sum_pipe(text)
    result = sentiment_pipeline(trans_sum)

    # Display the analysis result
    st.write("Text:", text)
    st.write("result:", result)