Spaces:
Runtime error
Runtime error
File size: 482 Bytes
a994631 3e9fd4b a994631 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import streamlit as st
import pickle
import sklearn
# load model
model = pickle.load(open('sentiment_analysis.pkl', 'rb'))
# create title
st.title('Sentiment Analysis Model')
review = st.text_input('Enter your review:')
submit = st.button('Predict')
if submit:
prediction = model.predict([review])
# print(prediction)
# st.write(prediction)
if prediction[0] == 'positive':
st.success('Positive Review')
else:
st.warning('Negative Review')
|