Spaces:
Running
Running
David Fischer
commited on
Commit
•
03411b5
1
Parent(s):
d487d35
Format the output
Browse files
app.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
import spacy
|
2 |
import gradio as gr
|
3 |
from textacy import preprocessing
|
@@ -17,7 +19,7 @@ preprocessor = preprocessing.make_pipeline(
|
|
17 |
def classify(input_text):
|
18 |
processed_input = preprocessor(input_text)
|
19 |
ea_output = ea_nlp(processed_input)
|
20 |
-
return
|
21 |
|
22 |
|
23 |
iface = gr.Interface(
|
|
|
1 |
+
from pprint import pformat
|
2 |
+
|
3 |
import spacy
|
4 |
import gradio as gr
|
5 |
from textacy import preprocessing
|
|
|
19 |
def classify(input_text):
|
20 |
processed_input = preprocessor(input_text)
|
21 |
ea_output = ea_nlp(processed_input)
|
22 |
+
return pformat(sorted(ea_output.cats.items(), key=lambda x: x[1], reverse=True))
|
23 |
|
24 |
|
25 |
iface = gr.Interface(
|