File size: 676 Bytes
107a7e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
import streamlit as st
from process import preprocess_text, Get_sentiment

def analyze_sentiment(text):
    text = preprocess_text(text)
# print(Review)
    result = Get_sentiment(text)
    return result


def main():
    st.title("Sentiment Analysis App")
    st.write("Enter text below for sentiment analysis:")

    # Text input
    text_input = st.text_area("Input Text")

    # Button to trigger sentiment analysis
    if st.button("Analyze"):
        if text_input:
            sentiment = analyze_sentiment(text_input)
            st.write("Sentiment:", sentiment[0])
        else:
            st.write("Please enter some text.")

if __name__ == "__main__":
    main()