Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,9 @@ import spacy
|
|
11 |
import os
|
12 |
from transformers import pipeline
|
13 |
import itertools
|
|
|
|
|
|
|
14 |
|
15 |
MODEL_TRANSFORMER_BASED = "distilbert-base-uncased"
|
16 |
MODEL_ONNX_FNAME = "ESG_classifier_batch.onnx"
|
@@ -160,10 +163,10 @@ examples = [[[['https://www.bbc.com/news/uk-62732447'],
|
|
160 |
['https://www.bbc.com/news/science-environment-62680423']],'url',False,5]]
|
161 |
demo = gr.Interface(fn=inference,
|
162 |
inputs=[gr.Dataframe(label='input batch', col_count=1, datatype='str', type='array', wrap=True),
|
163 |
-
gr.Dropdown(label='data type', choices=['text','url'], type='index'),
|
164 |
gr.Checkbox(label='if url parse cached in archive.org'),
|
165 |
-
gr.Slider(minimum=1, maximum=10, step=1, label='Limit NER output')],
|
166 |
-
outputs=[gr.Dataframe(label='output raw', col_count=1, datatype='number', type='array', wrap=True)],
|
167 |
#gr.Label(label='Company'),
|
168 |
#gr.Label(label='ESG'),
|
169 |
#gr.Label(label='Sentiment'),
|
|
|
11 |
import os
|
12 |
from transformers import pipeline
|
13 |
import itertools
|
14 |
+
import pandas as pd
|
15 |
+
|
16 |
+
OUT_HEADERS = ['E','S','G']
|
17 |
|
18 |
MODEL_TRANSFORMER_BASED = "distilbert-base-uncased"
|
19 |
MODEL_ONNX_FNAME = "ESG_classifier_batch.onnx"
|
|
|
163 |
['https://www.bbc.com/news/science-environment-62680423']],'url',False,5]]
|
164 |
demo = gr.Interface(fn=inference,
|
165 |
inputs=[gr.Dataframe(label='input batch', col_count=1, datatype='str', type='array', wrap=True),
|
166 |
+
gr.Dropdown(label='data type', choices=['text','url'], type='index', value='url'),
|
167 |
gr.Checkbox(label='if url parse cached in archive.org'),
|
168 |
+
gr.Slider(minimum=1, maximum=10, step=1, label='Limit NER output'), value=5],
|
169 |
+
outputs=[gr.Dataframe(label='output raw', col_count=1, datatype='number', type='array', wrap=True, header=OUT_HEADERS)],
|
170 |
#gr.Label(label='Company'),
|
171 |
#gr.Label(label='ESG'),
|
172 |
#gr.Label(label='Sentiment'),
|