Wootang01's picture
Update app.py
a005a37
import streamlit as st
from textblob import TextBlob
st.header("Sentiment Analyzer 2 -- Textblob")
st.write("""
"Input text and submit. First, the machine will present a sentiment score. A score closer to 1 indicates the machine classifying the text as containing positive sentiment. A score closer to -1 indicates the machine classifying the text as containing negative sentiment.
Furthermore, the machine will present a subjectivity score. A score closer to 1 indicates the machine classifying the text as containing most subjectivity whereas a score closer to 0 indicates the text as containing most objectivity."
""")
input = st.text_input("Input text and submit.")
if st.button("Submit"):
analysis = TextBlob(input)
polarity_score = analysis.sentiment.polarity
subjectivity_score = analysis.sentiment.subjectivity
st.write("Sentiment score: ", str(polarity_score), "Subjectivity score: ", str(subjectivity_score))