Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -130,14 +130,15 @@ def inference(input_batch,isurl,use_archive,limit_companies=10):
|
|
130 |
return prob_outs #ner_labels, {'E':float(prob_outs[0]),"S":float(prob_outs[1]),"G":float(prob_outs[2])},{sentiment['label']:float(sentiment['score'])},"**Summary:**\n\n" + summary
|
131 |
|
132 |
title = "ESG API Demo"
|
133 |
-
description = """This is a demonstration of the full ESG pipeline backend where given a URL (english, news) the news contents are extracted, using extractnet, and fed to three models:
|
134 |
|
135 |
- An off-the-shelf sentiment classification model (ProsusAI/finbert)
|
136 |
- A custom NER for the company extraction
|
137 |
- A custom ESG classifier for the ESG labeling of the news (the extracted text is also lemmatised prior to be fed to this classifier)
|
138 |
|
139 |
API input parameters:
|
140 |
-
-
|
|
|
141 |
- `use_archive`: boolean. The model will extract the archived version in archive.org of the url indicated. This is useful with old news and to bypass news behind paywall
|
142 |
- `limit_companies`: integer. Number of found relevant companies to report.
|
143 |
|
|
|
130 |
return prob_outs #ner_labels, {'E':float(prob_outs[0]),"S":float(prob_outs[1]),"G":float(prob_outs[2])},{sentiment['label']:float(sentiment['score'])},"**Summary:**\n\n" + summary
|
131 |
|
132 |
title = "ESG API Demo"
|
133 |
+
description = """This is a demonstration of the full ESG pipeline backend where given a list of URL (english, news) the news contents are extracted, using extractnet, and fed to three models:
|
134 |
|
135 |
- An off-the-shelf sentiment classification model (ProsusAI/finbert)
|
136 |
- A custom NER for the company extraction
|
137 |
- A custom ESG classifier for the ESG labeling of the news (the extracted text is also lemmatised prior to be fed to this classifier)
|
138 |
|
139 |
API input parameters:
|
140 |
+
- List: list of text. Either list of Url of the news (english) or list of extracted news contents
|
141 |
+
- 'Data type': int. 0=list is of extracted news contents, 1=list is of urls.
|
142 |
- `use_archive`: boolean. The model will extract the archived version in archive.org of the url indicated. This is useful with old news and to bypass news behind paywall
|
143 |
- `limit_companies`: integer. Number of found relevant companies to report.
|
144 |
|