File size: 511 Bytes
8d4917a
 
 
 
 
 
 
 
 
 
 
cd5d24d
350e1f5
 
 
8d4917a
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

import streamlit as st
from transformers import pipeline
st.title(" :smile: IMDB MOVIES SENTIMENT ANALYSIS")

user_input = st.text_input("Enter your text:")

classifier=pipeline("text-classification",model="flexnotop/imdb-v1",device=0)
if st.button("Classify"):
    if user_input:
        result=classifier(user_input)
        if result[0]['label']=="LABEL_1":
            st.write("Positive Rating")
        else:
            st.write("Negative Rating")
    else:
        st.write("Please enter some text")