themeetjani
commited on
Commit
·
274543c
1
Parent(s):
88e71fa
Update app.py
Browse files
app.py
CHANGED
@@ -26,8 +26,8 @@ stopwords = nltk.corpus.stopwords.words('english')
|
|
26 |
import gradio as gr
|
27 |
pipe = pipeline("text-classification", model="dsmsb/16class_12k_newtest1618_xlm_roberta_base_27nov_v2_8epoch")
|
28 |
def classify(text):
|
29 |
-
output = pipe(
|
30 |
-
return {"class":output}
|
31 |
inputs = gr.inputs.Textbox(label="pdf link")
|
32 |
outputs = gr.outputs.Textbox(label="OCR Text")
|
33 |
demo = gr.Interface(fn=classify,inputs=inputs,outputs=outputs)
|
|
|
26 |
import gradio as gr
|
27 |
pipe = pipeline("text-classification", model="dsmsb/16class_12k_newtest1618_xlm_roberta_base_27nov_v2_8epoch")
|
28 |
def classify(text):
|
29 |
+
output = pipe(text,top_k = 2)
|
30 |
+
return {"class": output}
|
31 |
inputs = gr.inputs.Textbox(label="pdf link")
|
32 |
outputs = gr.outputs.Textbox(label="OCR Text")
|
33 |
demo = gr.Interface(fn=classify,inputs=inputs,outputs=outputs)
|