Spaces:
Running
Running
fixing the layout for Ner classifications
Browse files
app.py
CHANGED
@@ -11,26 +11,18 @@ from spacy import glossary
|
|
11 |
|
12 |
entities = ["CARDINAL", "DATE", "EVENT", "FAC", "GPE", "LANGUAGE", "LAW", "LOC", "MONEY", "NORP", "ORDINAL", "ORG", "PERCENT", "PERSON", "PRODUCT", "QUANTITY", "TIME", "WORK_OF_ART"]
|
13 |
ent_dict = glossary.GLOSSARY
|
14 |
-
ent_sum = [f'{ent} = <i>{ent_dict[ent]}</i>' for ent in entities ]
|
15 |
|
16 |
with gr.Blocks() as demo:
|
17 |
gr.Markdown(
|
18 |
f"""
|
19 |
-
<style>
|
20 |
-
.list {{
|
21 |
-
display: grid;
|
22 |
-
grid-template-columns: 1fr 1fr 1fr;
|
23 |
-
}}
|
24 |
-
</style>
|
25 |
<div style="display: block; text-align: left; padding:0; margin:0;">
|
26 |
<h1 style="text-align: center">Babel Machine Demo</h1>
|
27 |
<p>This is a demo for text classification using language models finetuned on data labeled by <a href="https://www.comparativeagendas.net/">CAP</a>, <a href="https://manifesto-project.wzb.eu/">Manifesto Project</a>, sentiment, and emotion coding systems.<br>
|
28 |
For the coding of complete datasets, please visit the official <a href="https://babel.poltextlab.com/">Babel Machine</a> site.<br>
|
29 |
Please note that named entity inputs are case sensitive.<br>
|
30 |
-
For named entity recognition the following labels are used
|
31 |
-
|
32 |
-
<li class="list-item"> {'</li> <li class="list-item">'.join(ent_sum)} </li>
|
33 |
-
</ul>
|
34 |
</div>
|
35 |
""")
|
36 |
|
|
|
11 |
|
12 |
entities = ["CARDINAL", "DATE", "EVENT", "FAC", "GPE", "LANGUAGE", "LAW", "LOC", "MONEY", "NORP", "ORDINAL", "ORG", "PERCENT", "PERSON", "PRODUCT", "QUANTITY", "TIME", "WORK_OF_ART"]
|
13 |
ent_dict = glossary.GLOSSARY
|
14 |
+
ent_sum = [f'<b>{ent}</b> = <i>{ent_dict[ent]}</i>' for ent in entities ]
|
15 |
|
16 |
with gr.Blocks() as demo:
|
17 |
gr.Markdown(
|
18 |
f"""
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
<div style="display: block; text-align: left; padding:0; margin:0;">
|
20 |
<h1 style="text-align: center">Babel Machine Demo</h1>
|
21 |
<p>This is a demo for text classification using language models finetuned on data labeled by <a href="https://www.comparativeagendas.net/">CAP</a>, <a href="https://manifesto-project.wzb.eu/">Manifesto Project</a>, sentiment, and emotion coding systems.<br>
|
22 |
For the coding of complete datasets, please visit the official <a href="https://babel.poltextlab.com/">Babel Machine</a> site.<br>
|
23 |
Please note that named entity inputs are case sensitive.<br>
|
24 |
+
For named entity recognition the following labels are used:<br>
|
25 |
+
{';\t'.join(ent_sum)}</p>
|
|
|
|
|
26 |
</div>
|
27 |
""")
|
28 |
|