Spaces:
Runtime error
Runtime error
AroojImtiaz
commited on
Upload 3 files
Browse files- MLOps NLP.ipynb +0 -0
- app.py +23 -0
- sentiment_analysis.pkl +3 -0
MLOps NLP.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pickle
|
3 |
+
|
4 |
+
# load model
|
5 |
+
model = pickle.load(open('sentiment_analysis.pkl', 'rb'))
|
6 |
+
|
7 |
+
# create title
|
8 |
+
st.title('Sentiment Analysis Model')
|
9 |
+
|
10 |
+
review = st.text_input('Enter your review:')
|
11 |
+
|
12 |
+
submit = st.button('Predict')
|
13 |
+
|
14 |
+
if submit:
|
15 |
+
prediction = model.predict([review])
|
16 |
+
|
17 |
+
# print(prediction)
|
18 |
+
# st.write(prediction)
|
19 |
+
|
20 |
+
if prediction[0] == 'positive':
|
21 |
+
st.success('Positive Review')
|
22 |
+
else:
|
23 |
+
st.warning('Negative Review')
|
sentiment_analysis.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa7fffb45ffd63280a9c17218a159472940674396da2b9124a91d1a8c541d648
|
3 |
+
size 3613726
|