Spaces:
Running
Running
Updated numbers of prediction labels.
Browse files
app.py
CHANGED
@@ -36,11 +36,7 @@ def vectorize_text(text):
|
|
36 |
return text
|
37 |
|
38 |
# Valid input for the model so number of features match
|
39 |
-
|
40 |
-
text = vectorize_text(text)
|
41 |
-
text = text.toarray()
|
42 |
-
text = text.reshape(1, -1)
|
43 |
-
return text
|
44 |
|
45 |
# Prediction function
|
46 |
def predict(text):
|
@@ -54,7 +50,7 @@ demo = gr.Interface(fn=predict,
|
|
54 |
title="Text Classification Demo",
|
55 |
description="This is a demo of a text classification model using Logistic Regression.",
|
56 |
inputs=gr.Textbox(lines=10, placeholder='Input text here...', label="Input Text"),
|
57 |
-
outputs=gr.Textbox(label="Predicted Label: Other:
|
58 |
allow_flagging='never'
|
59 |
)
|
60 |
|
|
|
36 |
return text
|
37 |
|
38 |
# Valid input for the model so number of features match
|
39 |
+
# Code will go here
|
|
|
|
|
|
|
|
|
40 |
|
41 |
# Prediction function
|
42 |
def predict(text):
|
|
|
50 |
title="Text Classification Demo",
|
51 |
description="This is a demo of a text classification model using Logistic Regression.",
|
52 |
inputs=gr.Textbox(lines=10, placeholder='Input text here...', label="Input Text"),
|
53 |
+
outputs=gr.Textbox(label="Predicted Label: Other: 0, Healthcare: 1, Technology: 2", lines=2, placeholder='Predicted label will appear here...'),
|
54 |
allow_flagging='never'
|
55 |
)
|
56 |
|