Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
tfidf=pickle.load(open('tfidf.pkl','rb'))
|
| 2 |
model=pickle.load(open('model.pkl','rb'))
|
| 3 |
|
|
@@ -21,7 +29,7 @@ def preprocess(text):
|
|
| 21 |
|
| 22 |
iface = gr.Interface(
|
| 23 |
fn=classify_msg,
|
| 24 |
-
inputs=gr.inputs.Textbox(),
|
| 25 |
outputs="text",
|
| 26 |
)
|
| 27 |
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import pickle
|
| 3 |
+
import nltk
|
| 4 |
+
from nltk.corpus import stopwords
|
| 5 |
+
import string
|
| 6 |
+
from sklearn.feature_extraction.text import TfidfVectorizer
|
| 7 |
+
from sklearn.naive_bayes import MultinomialNB
|
| 8 |
+
|
| 9 |
tfidf=pickle.load(open('tfidf.pkl','rb'))
|
| 10 |
model=pickle.load(open('model.pkl','rb'))
|
| 11 |
|
|
|
|
| 29 |
|
| 30 |
iface = gr.Interface(
|
| 31 |
fn=classify_msg,
|
| 32 |
+
inputs=gr.inputs.Textbox(placeholder='If your message has more than 50 words, the probability of a correct prediction is high.'),
|
| 33 |
outputs="text",
|
| 34 |
)
|
| 35 |
|