Spaces:
Sleeping
Sleeping
Updated app.py.
Browse files
app.py
CHANGED
@@ -6,9 +6,9 @@ import pickle5 as pickle
|
|
6 |
# Load model from pickle file
|
7 |
model = pickle.load(open('lg_classifier.sav', 'rb'))
|
8 |
|
9 |
-
# Define function to predict
|
10 |
def predict(text):
|
11 |
-
return model.predict([text])
|
12 |
|
13 |
# Define interface
|
14 |
demo = gr.Interface(fn=predict,
|
|
|
6 |
# Load model from pickle file
|
7 |
model = pickle.load(open('lg_classifier.sav', 'rb'))
|
8 |
|
9 |
+
# Define function to predict label
|
10 |
def predict(text):
|
11 |
+
return model.predict([[text]])[0]
|
12 |
|
13 |
# Define interface
|
14 |
demo = gr.Interface(fn=predict,
|