File size: 868 Bytes
d0fb22a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import streamlit as st
import pandas as pd

def main():
    st.set_page_config(page_title="Emotion analysis", page_icon="🦜")
    st.header("Turn Your Input Into Sentiment Score")
    uploaded_file = st.file_uploader("Upload CSV File", type="csv")

    if uploaded_file is not None:
        # Process the uploaded file
        processed_data = process_uploaded_file(uploaded_file)
        # Display the processed data or perform further actions
        st.write(processed_data)

        #Stage 1: Translate and summary the text from Chinese to English and summarize
        st.text('Processing translation...')
        trans = tras_sum(uploaded_file.name)
        st.write(trans)

        #Stage 2: Sentiment analysis
        st.text('Generating a Sentiment result...')
        senti = sentiment(trans)
        st.write(senti)


if __name__ == "__main__":
    main()