Datasets:
laugustyniak
commited on
Commit
·
a6cefe1
1
Parent(s):
2b62b2b
info add
Browse files- dataset_infos.json +61 -0
- political_advertising_loader.py +4 -0
dataset_infos.json
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"political-advertising-pl": {
|
3 |
+
"description": "The shared task of CoNLL-2003 concerns language-independent named entity recognition. We will concentrate on\nfour types of named entities: persons, locations, organizations and names of miscellaneous entities that do\nnot belong to the previous three groups.\n\nThe CoNLL-2003 shared task data files contain four columns separated by a single space. Each word has been put on\na separate line and there is an empty line after each sentence. The first item on each line is a word, the second\na part-of-speech (POS) tag, the third a syntactic chunk tag and the fourth the named entity tag. The chunk tags\nand the named entity tags have the format I-TYPE which means that the word is inside a phrase of type TYPE. Only\nif two phrases of the same type immediately follow each other, the first word of the second phrase will have tag\nB-TYPE to show that it starts a new phrase. A word with tag O is not part of a phrase. Note the dataset uses IOB2\ntagging scheme, whereas the original dataset uses IOB1.\n\nFor more details see https://www.clips.uantwerpen.be/conll2003/ner/ and https://www.aclweb.org/anthology/W03-0419\n",
|
4 |
+
"citation": "@inproceedings{augustyniak-etal-2020-political,\n title = \"Political Advertising Dataset: the use case of the Polish 2020 Presidential Elections\",\n author = \"Augustyniak, Lukasz and\n Rajda, Krzysztof and\n Kajdanowicz, Tomasz and\n Bernaczyk, Micha{l}\",\n booktitle = \"Proceedings of the The Fourth Widening Natural Language Processing Workshop\",\n month = jul,\n year = \"2020\",\n address = \"Seattle, USA\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/2020.winlp-1.28\",\n pages = \"110--114\"",
|
5 |
+
"homepage": "https://github.com/laugustyniak/misinformation",
|
6 |
+
"license": "",
|
7 |
+
"features": {
|
8 |
+
"id": { "dtype": "string", "id": null, "_type": "Value" },
|
9 |
+
"tokens": {
|
10 |
+
"feature": { "dtype": "string", "id": null, "_type": "Value" },
|
11 |
+
"length": -1,
|
12 |
+
"id": null,
|
13 |
+
"_type": "Sequence"
|
14 |
+
},
|
15 |
+
"tags": {
|
16 |
+
"feature": {
|
17 |
+
"num_classes": 47,
|
18 |
+
"names": [
|
19 |
+
"O",
|
20 |
+
"B-DEFENSE_AND_SECURITY",
|
21 |
+
"I-DEFENSE_AND_SECURITY",
|
22 |
+
"B-EDUCATION",
|
23 |
+
"I-EDUCATION",
|
24 |
+
"B-FOREIGN_POLICY",
|
25 |
+
"I-FOREIGN_POLICY",
|
26 |
+
"B-HEALHCARE",
|
27 |
+
"I-HEALHCARE",
|
28 |
+
"B-IMMIGRATION",
|
29 |
+
"I-IMMIGRATION",
|
30 |
+
"B-INFRASTRUCTURE_AND_ENVIROMENT",
|
31 |
+
"I-INFRASTRUCTURE_AND_ENVIROMENT",
|
32 |
+
"B-POLITICAL_AND_LEGAL_SYSTEM",
|
33 |
+
"I-POLITICAL_AND_LEGAL_SYSTEM",
|
34 |
+
"B-SOCIETY",
|
35 |
+
"I-SOCIETY",
|
36 |
+
"B-WELFARE",
|
37 |
+
"I-WELFARE"
|
38 |
+
],
|
39 |
+
"names_file": null,
|
40 |
+
"id": null,
|
41 |
+
"_type": "ClassLabel"
|
42 |
+
},
|
43 |
+
"length": -1,
|
44 |
+
"id": null,
|
45 |
+
"_type": "Sequence"
|
46 |
+
}
|
47 |
+
},
|
48 |
+
"post_processed": null,
|
49 |
+
"supervised_keys": null,
|
50 |
+
"task_templates": null,
|
51 |
+
"builder_name": "political_advertising_loader",
|
52 |
+
"config_name": "political_advertising_loader",
|
53 |
+
"version": {
|
54 |
+
"version_str": "1.0.0",
|
55 |
+
"description": null,
|
56 |
+
"major": 1,
|
57 |
+
"minor": 0,
|
58 |
+
"patch": 0
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
political_advertising_loader.py
CHANGED
@@ -3,6 +3,8 @@ from pathlib import Path
|
|
3 |
import datasets
|
4 |
import pandas as pd
|
5 |
|
|
|
|
|
6 |
_CITATION = """\
|
7 |
@inproceedings{augustyniak-etal-2020-political,
|
8 |
title = "Political Advertising Dataset: the use case of the Polish 2020 Presidential Elections",
|
@@ -99,6 +101,8 @@ class PoliticalAdvertisingDataset(datasets.GeneratorBasedBuilder):
|
|
99 |
]
|
100 |
|
101 |
def _generate_examples(self, filepath: str):
|
|
|
|
|
102 |
df = pd.read_json(filepath)
|
103 |
for row_id, row in df.iterrows():
|
104 |
yield row_id, {
|
|
|
3 |
import datasets
|
4 |
import pandas as pd
|
5 |
|
6 |
+
logger = datasets.logging.get_logger(__name__)
|
7 |
+
|
8 |
_CITATION = """\
|
9 |
@inproceedings{augustyniak-etal-2020-political,
|
10 |
title = "Political Advertising Dataset: the use case of the Polish 2020 Presidential Elections",
|
|
|
101 |
]
|
102 |
|
103 |
def _generate_examples(self, filepath: str):
|
104 |
+
logger.info("⏳ Generating examples from = %s", filepath)
|
105 |
+
|
106 |
df = pd.read_json(filepath)
|
107 |
for row_id, row in df.iterrows():
|
108 |
yield row_id, {
|