sunil23391's picture
Update app.py
69d2881 verified
raw
history blame
624 Bytes
import os
os.system('pip install transformers')
os.system('pip install torch')
import streamlit as st
import transformers
classifier = transformers.pipeline("sentiment-analysis")
txt = st.text_area(
"Text to analyze",
"It was the best of times, it was the worst of times, it was the age of "
"wisdom, it was the age of foolishness, it was the epoch of belief, it "
"was the epoch of incredulity, it was the season of Light, it was the "
"season of Darkness, it was the spring of hope, it was the winter of "
"despair, (...)",
)
st.write(f'You wrote {len(txt)} characters.\n {classifier(txt)}')