idalr commited on
Commit
b80d372
1 Parent(s): f6d0f4c

Update dataset files

Browse files
Files changed (3) hide show
  1. README.md +218 -9
  2. requirements.txt +1 -1
  3. sciarg.py +31 -28
README.md CHANGED
@@ -1,25 +1,234 @@
1
  # PIE Dataset Card for "sciarg"
2
 
3
- This is a [PyTorch-IE](https://github.com/ChristophAlt/pytorch-ie) wrapper for the SciArg dataset.
4
 
5
- TODO: Since there is no respective HF dataset card for SciArg, we should all respective information here.
6
 
7
- TODO: Shortly reference the PIE-Brat dataset card.
8
 
9
- ## Data Schema
 
 
 
10
 
11
- TODO
12
 
13
- See [here](https://github.com/ChristophAlt/pytorch-ie/blob/main/src/pytorch_ie/annotations.py) for the remaining annotation type definitions.
 
14
 
15
- ## Document Converters
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  The dataset provides document converters for the following target document types:
18
 
19
  - `pytorch_ie.documents.TextDocumentWithLabeledSpansAndBinaryRelations`
20
- - TODO
 
 
 
 
 
21
  - `pytorch_ie.documents.TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions`
22
- - TODO (may reference the above)
 
 
 
23
 
24
  See [here](https://github.com/ChristophAlt/pytorch-ie/blob/main/src/pytorch_ie/documents.py) for the document type
25
  definitions.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # PIE Dataset Card for "sciarg"
2
 
3
+ This is a [PyTorch-IE](https://github.com/ChristophAlt/pytorch-ie) wrapper for the SciArg dataset ([paper](https://aclanthology.org/W18-5206/) and [data repository](https://github.com/anlausch/sciarg_resource_analysis)). Since the SciArg dataset is published in the [BRAT standoff format](https://brat.nlplab.org/standoff.html), this dataset builder is based on the [PyTorch-IE brat dataset loading script](https://huggingface.co/datasets/pie/brat).
4
 
5
+ Therefore, the `sciarg` dataset as described here follows the data structure from the [PIE brat dataset card](https://huggingface.co/datasets/pie/brat).
6
 
7
+ ### Dataset Summary
8
 
9
+ The SciArg dataset is an extension of the Dr. Inventor corpus (Fisas et al., [2015](https://aclanthology.org/W15-1605.pdf), [2016](https://aclanthology.org/L16-1492.pdf)) with an annotation layer containing
10
+ fine-grained argumentative components and relations, believing that argumentation needs to
11
+ be studied in combination with other rhetorical aspects. It is the first publicly-available argument-annotated corpus of scientific publications (in English), which allows for joint analyses of argumentation and other
12
+ rhetorical dimensions of scientific writing." ([Lauscher et al., 2018](<(https://aclanthology.org/W18-5206/)>), pp. 40-41)
13
 
14
+ ### Supported Tasks and Leaderboards
15
 
16
+ - **Tasks**: Argumentation Mining, Component Identification, Relation Identification
17
+ - **Leaderboard:** [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
18
 
19
+ ### Languages
20
+
21
+ The language in the dataset is English (scientific academic publications on computer graphics).
22
+
23
+ ### Dataset Variants
24
+
25
+ The `sciarg` dataset comes in a single version (`default`) with `BratDocumentWithMergedSpans` as document type. Note,
26
+ that this in contrast to the base `brat` dataset, where the document type for the `default` variant is `BratDocument`.
27
+ The reason is that the SciArg dataset was published with spans that are just fragmented by whitespace which seems
28
+ to be because of the annotation tool used. In the `sciarg` dataset, we merge these fragments, so that the document type
29
+ can be `BratDocumentWithMergedSpans` (this is easier to handle for most of the task modules). However, fragmented
30
+ spans are conceptually also available in SciArg, but they are marked with the `parts_of_same` relation which are kept
31
+ as they are in the `sciarg` (`default`) dataset.
32
+
33
+ ### Data Schema
34
+
35
+ See [PIE-Brat Data Schema](https://huggingface.co/datasets/pie/brat#data-schema).
36
+
37
+ ### Usage
38
+
39
+ ```python
40
+ from pie_datasets import load_dataset, builders
41
+
42
+ # load default version
43
+ datasets = load_dataset("pie/sciarg")
44
+ doc = datasets["train"][0]
45
+ assert isinstance(doc, builders.brat.BratDocument)
46
+
47
+ # load version with merged span fragments
48
+ dataset_merged_spans = load_dataset("pie/sciarg", name="merge_fragmented_spans")
49
+ doc_merged_spans = dataset_merged_spans["train"][0]
50
+ assert isinstance(doc_merged_spans, builders.brat.BratDocumentWithMergedSpans)
51
+ ```
52
+
53
+ ### Document Converters
54
 
55
  The dataset provides document converters for the following target document types:
56
 
57
  - `pytorch_ie.documents.TextDocumentWithLabeledSpansAndBinaryRelations`
58
+ - `LabeledSpans`, converted from `BratDocument`'s `spans`
59
+ - labels: `background_claim`, `own_claim`, `data`
60
+ - if `spans` contain whitespace at the beginning and/or the end, the whitespace are trimmed out.
61
+ - `BinraryRelations`, converted from `BratDocument`'s `relations`
62
+ - labels: `supports`, `contradicts`, `semantically_same`, `parts_of_same`
63
+ - if the `relations` label is `semantically_same` or `parts_of_same`, they are merged if they are the same arguments after sorting.
64
  - `pytorch_ie.documents.TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions`
65
+ - `LabeledSpans`, as above
66
+ - `BinaryRelations`, as above
67
+ - `LabeledPartitions`, partitioned `BratDocument`'s `text`, according to the paragraph, using regex.
68
+ - labels: `title`, `abstract`, `H1`
69
 
70
  See [here](https://github.com/ChristophAlt/pytorch-ie/blob/main/src/pytorch_ie/documents.py) for the document type
71
  definitions.
72
+
73
+ ### Data Splits
74
+
75
+ The dataset consists of a single `train` split that has 40 documents.
76
+
77
+ For detailed statistics on the corpus, see Lauscher et al. ([2018](<(https://aclanthology.org/W18-5206/)>), p. 43), and the author's [resource analysis](https://github.com/anlausch/sciarg_resource_analysis).
78
+
79
+ ### Label Descriptions
80
+
81
+ #### Components
82
+
83
+ | Components | Count | Percentage |
84
+ | ------------------ | ----: | ---------: |
85
+ | `background_claim` | 3291 | 24.2 % |
86
+ | `own_claim` | 6004 | 44.2 % |
87
+ | `data` | 4297 | 31.6 % |
88
+
89
+ - `own_claim` is an argumentative statement that closely relates to the authors’ own work.
90
+ - `background_claim` an argumentative statement relating to the background of authors’ work, e.g., about related work or common practices.
91
+ - `data` component represents a fact that serves as evidence for or against a claim. Note that references or (factual) examples can also serve as data.
92
+ (Lauscher et al. 2018, p.41; following and simplified [Toulmin, 2003](https://www.cambridge.org/core/books/uses-of-argument/26CF801BC12004587B66778297D5567C))
93
+
94
+ #### Relations
95
+
96
+ | Relations | Count | Percentage |
97
+ | -------------------------- | ----: | ---------: |
98
+ | support: `support` | 5791 | 74.0 % |
99
+ | attack: `contradict` | 697 | 8.9 % |
100
+ | other: `semantically_same` | 44 | 0.6 % |
101
+ | other: `parts_of_same` | 1298 | 16.6 % |
102
+
103
+ ##### Argumentative relations
104
+
105
+ - `support`:
106
+ - if the assumed veracity of *b* increases with the veracity of *a*
107
+ - "Usually, this relationship exists from data to claim, but in many cases a claim might support another claim. Other combinations are still possible." - (*Annotation Guidelines*, p. 3)
108
+ - `contradict`:
109
+ - if the assumed veracity of *b* decreases with the veracity of *a*
110
+ - It is a **bi-directional**, i.e., symmetric relationship.
111
+
112
+ ##### Non-argumentative relations
113
+
114
+ - `semantically_same`: between two mentions of effectively the same claim or data component. Can be seen as *argument coreference*, analogous to entity, and *event coreference*. This relation is considered symmetric (i.e., **bidirectional**) and non-argumentative.
115
+ (Lauscher et al. 2018, p.41; following [Dung, 1995](https://www.sciencedirect.com/science/article/pii/000437029400041X?via%3Dihub))
116
+ - `parts_of_same`: when a single component is split up in several parts. It is **non-argumentative**, **bidirectional**, but also **intra-component**
117
+
118
+ (*Annotation Guidelines*, pp. 4-6)
119
+
120
+ **Important note on label counts**:
121
+
122
+ There are currently discrepancies in label counts between
123
+
124
+ - previous report in [Lauscher et al., 2018](https://aclanthology.org/W18-5206/), p. 43),
125
+ - current report above here (labels counted in `BratDocument`'s);
126
+
127
+ possibly since [Lauscher et al., 2018](https://aclanthology.org/W18-5206/) presents the numbers of the real argumentative components, whereas here discontinuous components are still split (marked with the `parts_of_same` helper relation) and, thus, count per fragment.
128
+
129
+ ## Dataset Creation
130
+
131
+ ### Curation Rationale
132
+
133
+ "\[C\]omputational methods for analyzing scientific writing are becoming paramount...there is no publicly available corpus of scientific publications (in English), annotated with fine-grained argumentative structures. ...\[A\]rgumentative structure of scientific publications should not be studied in isolation, but rather in relation to other rhetorical aspects, such as the
134
+ discourse structure.
135
+ (Lauscher et al. 2018, p. 40)
136
+
137
+ ### Source Data
138
+
139
+ #### Initial Data Collection and Normalization
140
+
141
+ "\[W\]e randomly selected a set of 40 documents, available in PDF format, among a bigger collection provided by experts in the domain, who pre-selected a representative sample of articles in Computer Graphics. Articles were classified into four important subjects in this area: Skinning, Motion Capture, Fluid Simulation and Cloth Simulation. We included in the corpus 10 highly representative articles for each subject." (Fisas et al. 2015, p. 44)
142
+
143
+ "The Corpus includes 10,789 sentences, with an average of 269.7 sentences per document." (p. 45)
144
+
145
+ #### Who are the source language producers?
146
+
147
+ It can be implied from the data source that the language producers were academics in computer graphics and related fields, possibly assisted by other human editors.
148
+
149
+ ### Annotations
150
+
151
+ #### Annotation process
152
+
153
+ "We trained the four annotators in a calibration phase, consisting of five iterations, in each of which all annotators annotated one publication. After each iteration we computed the inter-annotator agreement (IAA), discussed the disagreements, and, if needed, adjourned the [annotation guidelines](https://data.dws.informatik.uni-mannheim.de/sci-arg/annotation_guidelines.pdf)."
154
+
155
+ The detailed evolution of IAA over the five calibration iterations is depicted in Lauscher et al. (2018), p. 42, Figure 1.
156
+
157
+ The annotation were done using BRAT Rapid Annotation Tool ([Stenetorp et al., 2012](https://aclanthology.org/E12-2021/)).
158
+
159
+ #### Who are the annotators?
160
+
161
+ "We hired one expert (a researcher in computational linguistics) and three non-expert annotators (humanities and social sciences scholars)." (Lauscher et al. 2018, p. 42)
162
+
163
+ ### Personal and Sensitive Information
164
+
165
+ \[More Information Needed\]
166
+
167
+ ## Considerations for Using the Data
168
+
169
+ ### Social Impact of Dataset
170
+
171
+ "To support learning-based models for automated analysis of scientific publications, potentially leading to better understanding
172
+ of the different rhetorical aspects of scientific language (which we dub *scitorics*)." (Lauscher et al. 2018, p. 40)
173
+
174
+ "The resulting corpus... is, to the best of our knowledge, the first argument-annotated corpus of scientific publications in English, enables (1) computational analysis of argumentation in scientific writing and (2) integrated analysis of argumentation and other rhetorical aspects of scientific text." (Lauscher et al. 2018, p. 44)
175
+
176
+ ### Discussion of Biases
177
+
178
+ "...not all claims are supported and secondly, claims can be supported by other claims. There are many more supports than contradicts relations."
179
+
180
+ "While the background claims and own claims are on average of similar length (85 and 87 characters, respectively), they are much longer than data components (average of 25 characters)."
181
+
182
+ "\[A\]nnotators identified an average of 141 connected component per publication...This indicates that either authors write very short argumentative chains or that our annotators had difficulties noticing long-range argumentative dependencies."
183
+
184
+ (Lauscher et al. 2018, p.43)
185
+
186
+ ### Other Known Limitations
187
+
188
+ "Expectedly, we observe higher agreements with more calibration. The agreement on argumentative relations is 23% lower than on the components, which we think is due to the high ambiguity of argumentation structures."
189
+
190
+ "Additionally, disagreements in component identification are propagated to relations as well, since the agreement on a relation implies the agreement on annotated components at both ends of the relation."
191
+
192
+ (Lauscher et al. 2018, p. 43)
193
+
194
+ ## Additional Information
195
+
196
+ ### Dataset Curators
197
+
198
+ - **Repository:** [https://github.com/anlausch/ArguminSci](https://github.com/anlausch/ArguminSci)
199
+
200
+ ### Licensing Information
201
+
202
+ [MIT License](https://github.com/anlausch/ArguminSci/blob/master/LICENSE)
203
+
204
+ This research was partly funded by the German Research Foundation (DFG), grant number EC 477/5-1 (LOC-DB).
205
+
206
+ ### Citation Information
207
+
208
+ ```
209
+ @inproceedings{lauscher2018b,
210
+ title = {An argument-annotated corpus of scientific publications},
211
+ booktitle = {Proceedings of the 5th Workshop on Mining Argumentation},
212
+ publisher = {Association for Computational Linguistics},
213
+ author = {Lauscher, Anne and Glava\v{s}, Goran and Ponzetto, Simone Paolo},
214
+ address = {Brussels, Belgium},
215
+ year = {2018},
216
+ pages = {40–46}
217
+ }
218
+ ```
219
+
220
+ ```
221
+ @inproceedings{lauscher2018a,
222
+ title = {ArguminSci: A Tool for Analyzing Argumentation and Rhetorical Aspects in Scientific Writing},
223
+ booktitle = {Proceedings of the 5th Workshop on Mining Argumentation},
224
+ publisher = {Association for Computational Linguistics},
225
+ author = {Lauscher, Anne and Glava\v{s}, Goran and Eckert, Kai},
226
+ address = {Brussels, Belgium},
227
+ year = {2018},
228
+ pages = {22–28}
229
+ }
230
+ ```
231
+
232
+ ### Contributions
233
+
234
+ Thanks to [@ArneBinder](https://github.com/ArneBinder) and [@idalr](https://github.com/idalr) for adding this dataset.
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
- pie-datasets>=0.6.0,<0.8.0
2
  pie-modules>=0.8.0,<0.9.0
 
1
+ pie-datasets>=0.6.0,<0.9.0
2
  pie-modules>=0.8.0,<0.9.0
sciarg.py CHANGED
@@ -9,8 +9,8 @@ from pytorch_ie.documents import (
9
  TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions,
10
  )
11
 
12
- from pie_datasets.builders import BratBuilder
13
- from pie_datasets.core.dataset import DocumentConvertersType
14
  from pie_datasets.document.processing import Caster, Pipeline
15
 
16
  URL = "http://data.dws.informatik.uni-mannheim.de/sci-arg/compiled_corpus.zip"
@@ -33,7 +33,17 @@ def get_common_pipeline_steps(target_document_type: type[Document]) -> dict:
33
 
34
  class SciArg(BratBuilder):
35
  BASE_DATASET_PATH = "DFKI-SLT/brat"
36
- BASE_DATASET_REVISION = "052163d34b4429d81003981bc10674cef54aa0b8"
 
 
 
 
 
 
 
 
 
 
37
 
38
  # we need to add None to the list of dataset variants to support the default dataset variant
39
  BASE_BUILDER_KWARGS_DICT = {
@@ -41,28 +51,21 @@ class SciArg(BratBuilder):
41
  for dataset_variant in ["default", "merge_fragmented_spans", None]
42
  }
43
 
44
- @property
45
- def document_converters(self) -> DocumentConvertersType:
46
- if self.config.name == "default":
47
- return {}
48
- elif self.config.name == "merge_fragmented_spans":
49
- return {
50
- TextDocumentWithLabeledSpansAndBinaryRelations: Pipeline(
51
- **get_common_pipeline_steps(TextDocumentWithLabeledSpansAndBinaryRelations)
52
- ),
53
- TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions: Pipeline(
54
- **get_common_pipeline_steps(
55
- TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions
56
- ),
57
- add_partitions=RegexPartitioner(
58
- partition_layer_name="labeled_partitions",
59
- pattern="<([^>/]+)>.*</\\1>",
60
- label_group_id=1,
61
- label_whitelist=["Title", "Abstract", "H1"],
62
- skip_initial_partition=True,
63
- strip_whitespace=True,
64
- ),
65
- ),
66
- }
67
- else:
68
- raise ValueError(f"Unknown dataset variant: {self.config.name}")
 
9
  TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions,
10
  )
11
 
12
+ from pie_datasets.builders import BratBuilder, BratConfig
13
+ from pie_datasets.builders.brat import BratDocumentWithMergedSpans
14
  from pie_datasets.document.processing import Caster, Pipeline
15
 
16
  URL = "http://data.dws.informatik.uni-mannheim.de/sci-arg/compiled_corpus.zip"
 
33
 
34
  class SciArg(BratBuilder):
35
  BASE_DATASET_PATH = "DFKI-SLT/brat"
36
+ BASE_DATASET_REVISION = "844de61e8a00dc6a93fc29dc185f6e617131fbf1"
37
+
38
+ # Overwrite the default config to merge the span fragments.
39
+ # The span fragments in SciArg come just from the new line splits, so we can merge them.
40
+ # Actual span fragments are annotated via "parts_of_same" relations.
41
+ BUILDER_CONFIGS = [
42
+ BratConfig(name=BratBuilder.DEFAULT_CONFIG_NAME, merge_fragmented_spans=True),
43
+ ]
44
+ DOCUMENT_TYPES = {
45
+ BratBuilder.DEFAULT_CONFIG_NAME: BratDocumentWithMergedSpans,
46
+ }
47
 
48
  # we need to add None to the list of dataset variants to support the default dataset variant
49
  BASE_BUILDER_KWARGS_DICT = {
 
51
  for dataset_variant in ["default", "merge_fragmented_spans", None]
52
  }
53
 
54
+ DOCUMENT_CONVERTERS = {
55
+ TextDocumentWithLabeledSpansAndBinaryRelations: Pipeline(
56
+ **get_common_pipeline_steps(TextDocumentWithLabeledSpansAndBinaryRelations)
57
+ ),
58
+ TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions: Pipeline(
59
+ **get_common_pipeline_steps(
60
+ TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions
61
+ ),
62
+ add_partitions=RegexPartitioner(
63
+ partition_layer_name="labeled_partitions",
64
+ pattern="<([^>/]+)>.*</\\1>",
65
+ label_group_id=1,
66
+ label_whitelist=["Title", "Abstract", "H1"],
67
+ skip_initial_partition=True,
68
+ strip_whitespace=True,
69
+ ),
70
+ ),
71
+ }