Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ classifier = pipeline("text-classification", model="HooshvareLab/bert-fa-base-un
|
|
5 |
|
6 |
def classify_text(text):
|
7 |
result = classifier(text)
|
8 |
-
|
|
|
9 |
|
10 |
iface = gr.Interface(fn=classify_text, inputs="text", outputs="text", title="Persian News Classifier")
|
11 |
-
|
12 |
-
iface.launch()
|
|
|
5 |
|
6 |
def classify_text(text):
|
7 |
result = classifier(text)
|
8 |
+
# Return in a consistent format
|
9 |
+
return result[0]["label"] # Just returns the label as a string
|
10 |
|
11 |
iface = gr.Interface(fn=classify_text, inputs="text", outputs="text", title="Persian News Classifier")
|
12 |
+
iface.launch()
|
|