File size: 580 Bytes
b8f1cfd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
# coding: utf-8

# In[4]:


import pickle
import streamlit as st

model=pickle.load(open('sentiment_analysis_model.p','rb'))

st.title(' Sentiment Analysis Model ')

st.write('Enter text for sentiment analysis:')
message = st.text_area("","Type Here ...")
if st.button('PREDICT'):
    disp=" "
    a = model.predict([message])[0]
    if(a == 'pos'):
        disp = "Positive Sentiment!"
    else:
        disp = "Negative Sentiment!"
    st.write('The sentiment of given text is:', disp)
    # st.header(f"**{a}**")
    # q = model.predict_proba([message])