sentiment_try / app.py
Arvind111's picture
Update app.py
f16f00e verified
raw
history blame contribute delete
539 Bytes
from transformers import pipeline
import streamlit as st
# Load the classification pipeline with the specified model
pipe = pipeline("text-classification", model="tabularisai/multilingual-sentiment-analysis")
st.title("sentiment analysis model")
user_input = st.text_area('Enter Text: ')
if user_input:
result = pipe(user_input)[0]
st.write(f"sentiment : {result['label']}")
# Classify a new sentence
sentence = "I love this product! It's amazing and works perfectly."
result = pipe(sentence)
# Print the result
print(result)