Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import pickle
|
| 3 |
|
|
|
|
| 4 |
with open('singlish_comment_classifier_v3.pkl', "rb") as f:
|
| 5 |
model_singlish = pickle.load(f)
|
| 6 |
|
| 7 |
with open('sinhala_comment_classifier_v1.pkl', "rb") as f:
|
| 8 |
model_sinhala = pickle.load(f)
|
| 9 |
|
|
|
|
|
|
|
| 10 |
def predict_sinhala(text):
|
| 11 |
prediction = model_sinhala.predict([text])
|
| 12 |
return "POSITIVE" if prediction[0] == 1 else "NEGATIVE"
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pickle
|
| 3 |
|
| 4 |
+
#for loading models
|
| 5 |
with open('singlish_comment_classifier_v3.pkl', "rb") as f:
|
| 6 |
model_singlish = pickle.load(f)
|
| 7 |
|
| 8 |
with open('sinhala_comment_classifier_v1.pkl', "rb") as f:
|
| 9 |
model_sinhala = pickle.load(f)
|
| 10 |
|
| 11 |
+
|
| 12 |
+
|
| 13 |
def predict_sinhala(text):
|
| 14 |
prediction = model_sinhala.predict([text])
|
| 15 |
return "POSITIVE" if prediction[0] == 1 else "NEGATIVE"
|