File size: 539 Bytes
334edf9
3b52803
334edf9
 
 
3b52803
 
 
 
 
 
f16f00e
3b52803
334edf9
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)