mingaflo commited on
Commit
abd5170
·
1 Parent(s): a6da0c4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +212 -0
README.md CHANGED
@@ -1,3 +1,215 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ task_categories:
4
+ - summarization
5
+ language:
6
+ - de
7
+ tags:
8
+ - wikipedia
9
+ - wikidata
10
+ - Relation Extraction
11
+ - REBEL
12
+ pretty_name: German REBEL Dataset
13
+ size_categories:
14
+ - 100K<n<1M
15
  ---
16
+
17
+ # Dataset Card for German REBEL Dataset
18
+
19
+ ### Dataset Summary
20
+
21
+ This dataset is the German version of Babelscape/rebel-dataset. It has been generated using [CROCODILE](https://github.com/Babelscape/crocodile).
22
+ The Wikipedia Version is from November 2022.
23
+
24
+ ### Languages
25
+
26
+ - German
27
+
28
+ ## Dataset Structure
29
+
30
+ ```
31
+ {"docid": "9400003",
32
+ "title": "Odin-Gletscher",
33
+ "uri": "Q7077818",
34
+ "text": "Der Odin-Gletscher ist ein kleiner Gletscher im ostantarktischen Viktorialand. Er fließt von den Westhängen des Mount Odin in der Asgard Range.\n\nDas New Zealand Antarctic Place-Names Committee benannte ihn in Anlehnung an die Benennung des Mount Odin nach Odin, Göttervater, Kriegs- und Totengott der nordischen Mythologie.",
35
+ "entities": [{"uri": "Q35666", "boundaries": [35, 44], "surfaceform": "Gletscher", "annotator": "Me"}, ... ],
36
+ "triples": [{"subject": {"uri": "Q7077818", "boundaries": [4, 18], "surfaceform": "Odin-Gletscher", "annotator": "Me"},
37
+ "predicate": {"uri": "P31", "boundaries": null, "surfaceform": "ist ein(e)", "annotator": "NoSubject-Triple-aligner"},
38
+ "object": {"uri": "Q35666", "boundaries": [35, 44], "surfaceform": "Gletscher", "annotator": "Me"}, "sentence_id": 0,
39
+ "dependency_path": null,
40
+ "confidence": 0.99560546875,
41
+ "annotator": "NoSubject-Triple-aligner"}, ...]
42
+ }
43
+ ```
44
+
45
+ ### Data Instances
46
+
47
+
48
+ ### Data Fields
49
+
50
+ "docid": "9644601",
51
+ "title": Wikipedia Title
52
+ "uri": "Q4290759",
53
+ "text": Wikipedia Abstract
54
+ "entities": A list of Entities
55
+ - uri: Wikidata URI
56
+ - boundaries: Tuple of indices of the entity in the abstract
57
+ - surfaceform: text form of entity
58
+ - annotator: different annotator classes
59
+ "triples": List of Triples as dictionaries
60
+ - sentence_id: Sentence number the triple appears in.
61
+ - "confidence": float, the confidence of the NLI Model
62
+ - subject
63
+ - uri: Wikidata Entity URI
64
+ - boundaries
65
+ - surfaceform
66
+ - annotator
67
+ - predicate
68
+ - uri: Wikidata Relation URI
69
+ - boundaries: always null,
70
+ - surfaceform: Wikidata Relation Name
71
+ - annotator
72
+ - object:
73
+ - uri: Wikidata Entity URI
74
+ - boundaries
75
+ - surfaceform
76
+ - annotator
77
+
78
+
79
+
80
+ ### Data Splits
81
+
82
+ No splits are provided for now since the relation classes are quite imbalanced.
83
+ To read the dataset you can adapt the function provided by https://github.com/Babelscape/rebel
84
+
85
+ ```
86
+ def _generate_examples(self, filepath):
87
+ """This function returns the examples in the raw (text) form."""
88
+ logging.info("generating examples from = %s", filepath)
89
+ relations_df = pd.read_csv(self.config.data_files['relations'], header = None, sep='\t')
90
+ relations = list(relations_df[0])
91
+
92
+ with open(filepath, encoding="utf-8") as f:
93
+ for id_, row in enumerate(f):
94
+ article = json.loads(row)
95
+ prev_len = 0
96
+ if len(article['triples']) == 0:
97
+ continue
98
+ count = 0
99
+ for text_paragraph in article['text'].split('\n'):
100
+ if len(text_paragraph) == 0:
101
+ continue
102
+ sentences = re.split(r'(?<=[.])\s', text_paragraph)
103
+ text = ''
104
+ for sentence in sentences:
105
+ text += sentence + ' '
106
+ if any([entity['boundaries'][0] < len(text) + prev_len < entity['boundaries'][1] for entity in article['entities']]):
107
+ continue
108
+ entities = sorted([entity for entity in article['entities'] if prev_len < entity['boundaries'][1] <= len(text)+prev_len], key=lambda tup: tup['boundaries'][0])
109
+ decoder_output = '<triplet> '
110
+ for int_ent, entity in enumerate(entities):
111
+ triplets = sorted([triplet for triplet in article['triples'] if triplet['subject'] == entity and prev_len< triplet['subject']['boundaries'][1]<=len(text) + prev_len and prev_len< triplet['object']['boundaries'][1]<=len(text)+ prev_len and triplet['predicate']['surfaceform'] in relations], key=lambda tup: tup['object']['boundaries'][0])
112
+ if len(triplets) == 0:
113
+ continue
114
+ decoder_output += entity['surfaceform'] + ' <subj> '
115
+ for triplet in triplets:
116
+ decoder_output += triplet['object']['surfaceform'] + ' <obj> ' + triplet['predicate']['surfaceform'] + ' <subj> '
117
+ decoder_output = decoder_output[:-len(' <subj> ')]
118
+ decoder_output += ' <triplet> '
119
+ decoder_output = decoder_output[:-len(' <triplet> ')]
120
+ count += 1
121
+ prev_len += len(text)
122
+
123
+ if len(decoder_output) == 0:
124
+ text = ''
125
+ continue
126
+
127
+ text = re.sub('([\[\].,!?()])', r' \1 ', text.replace('()', ''))
128
+ text = re.sub('\s{2,}', ' ', text)
129
+
130
+ yield article['uri'] + '-' + str(count), {
131
+ "title": article['title'],
132
+ "context": text,
133
+ "id": article['uri'] + '-' + str(count),
134
+ "triplets": decoder_output,
135
+ }
136
+ text = ''
137
+ ```
138
+
139
+ ## Dataset Creation
140
+
141
+ ### Curation Rationale
142
+
143
+ This dataset was created to enable the training of a german BART based model as pre-training phase for Relation Extraction.
144
+
145
+ ### Source Data
146
+
147
+ #### Initial Data Collection and Normalization
148
+
149
+ [More Information Needed]
150
+
151
+ #### Who are the source language producers?
152
+
153
+ Any Wikipedia and Wikidata contributor.
154
+
155
+ ### Annotations
156
+
157
+ #### Annotation process
158
+
159
+ The dataset extraction pipeline cRocoDiLe: Automatic Relation Extraction Dataset with NLI filtering.
160
+
161
+ #### Who are the annotators?
162
+
163
+ Automatic annottations
164
+
165
+ ### Personal and Sensitive Information
166
+
167
+ All text is from Wikipedia, any Personal or Sensitive Information there may be present in this dataset.
168
+
169
+ ## Considerations for Using the Data
170
+
171
+ ### Social Impact of Dataset
172
+ The dataset serves as a pre-training step for Relation Extraction models. It is distantly annotated, hence it should only be used as such. A model trained solely on this dataset may produce allucinations coming from the silver nature of the dataset.
173
+
174
+ ### Discussion of Biases
175
+
176
+ Since the dataset was automatically created from Wikipedia and Wikidata, it may reflect the biases withing those sources.
177
+
178
+ For Wikipedia text, see for example Dinan et al 2020 on biases in Wikipedia (esp. Table 1), or Blodgett et al 2020 for a more general discussion of the topic.
179
+
180
+ For Wikidata, there are class imbalances, also resulting from Wikipedia.
181
+
182
+ ### Other Known Limitations
183
+
184
+ Not for now
185
+
186
+ ## Additional Information
187
+
188
+ ### Dataset Curators
189
+
190
+ Me
191
+
192
+ ### Licensing Information
193
+
194
+ Since anyone can create the dataset on their own using the linked GitHub Repository, I am going to use the MIT Licence.
195
+
196
+ ### Citation Information
197
+
198
+ Inspiration by:
199
+ ```
200
+ @inproceedings{huguet-cabot-navigli-2021-rebel,
201
+ title = "REBEL: Relation Extraction By End-to-end Language generation",
202
+ author = "Huguet Cabot, Pere-Llu{\'\i}s and
203
+ Navigli, Roberto",
204
+ booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2021",
205
+ month = nov,
206
+ year = "2021",
207
+ address = "Online and in the Barceló Bávaro Convention Centre, Punta Cana, Dominican Republic",
208
+ publisher = "Association for Computational Linguistics",
209
+ url = "https://github.com/Babelscape/rebel/blob/main/docs/EMNLP_2021_REBEL__Camera_Ready_.pdf",
210
+ }
211
+ ```
212
+
213
+ ### Contributions
214
+
215
+ None for now