ArneBinder commited on
Commit
f8384c7
·
verified ·
1 Parent(s): 6096fe9

use pie-modules instead of pytorch-ie

Browse files

see https://github.com/ArneBinder/pie-datasets/pull/204 for further information

Files changed (3) hide show
  1. README.md +15 -14
  2. abstrct.py +1 -1
  3. requirements.txt +2 -1
README.md CHANGED
@@ -15,14 +15,14 @@ in order to support clinicians' daily tasks in information finding and evidence-
15
  ```python
16
  from pie_datasets import load_dataset
17
  from pie_datasets.builders.brat import BratDocumentWithMergedSpans
18
- from pytorch_ie.documents import TextDocumentWithLabeledSpansAndBinaryRelations
19
 
20
  # load default version
21
  dataset = load_dataset("pie/abstrct")
22
  assert isinstance(dataset["neoplasm_train"][0], BratDocumentWithMergedSpans)
23
 
24
  # if required, normalize the document type (see section Document Converters below)
25
- dataset_converted = dataset.to_document_type("pytorch_ie.documents.TextDocumentWithLabeledSpansAndBinaryRelations")
26
  assert isinstance(dataset_converted["neoplasm_train"][0], TextDocumentWithLabeledSpansAndBinaryRelations)
27
 
28
  # get first relation in the first document
@@ -57,13 +57,13 @@ See [PIE-Brat Data Schema](https://huggingface.co/datasets/pie/brat#data-schema)
57
 
58
  The dataset provides document converters for the following target document types:
59
 
60
- - `pytorch_ie.documents.TextDocumentWithLabeledSpansAndBinaryRelations`
61
  - `LabeledSpans`, converted from `BratDocumentWithMergedSpans`'s `spans`
62
  - labels: `MajorClaim`, `Claim`, `Premise`
63
  - `BinraryRelations`, converted from `BratDocumentWithMergedSpans`'s `relations`
64
- - labels: `Support`, `Partial-Attack`, `Attack`
65
 
66
- See [here](https://github.com/ChristophAlt/pytorch-ie/blob/main/src/pytorch_ie/documents.py) for the document type definitions.
67
 
68
  ### Data Splits
69
 
@@ -93,7 +93,7 @@ Morio et al. ([2022](https://aclanthology.org/2022.tacl-1.37.pdf); p. 642, Table
93
 
94
  - `MajorClaim` are more general/concluding `claim`'s, which is supported by more specific claims
95
  - `Claim` is a concluding statement made by the author about the outcome of the study. Claims only points to other claims.
96
- - `Premise` (a.k.a. evidence) is an observation or measurement in the study, which supports or attacks another argument component, usually a `claim`. They are observed facts, and therefore credible without further justifications, as this is the ground truth the argumentation is based on.
97
 
98
  (Mayer et al. 2020, p.2110)
99
 
@@ -118,7 +118,8 @@ Morio et al. ([2022](https://aclanthology.org/2022.tacl-1.37.pdf); p. 642, Table
118
 
119
  #### Example
120
 
121
- ![abstr-sam.png](img%2Fabstr-sam.png)
 
122
 
123
  ### Collected Statistics after Document Conversion
124
 
@@ -141,7 +142,7 @@ input:
141
  revision: 277dc703fd78614635e86fe57c636b54931538b2
142
  ```
143
 
144
- For token based metrics, this uses `bert-base-uncased` from `transformer.AutoTokenizer` (see [AutoTokenizer](https://huggingface.co/docs/transformers/v4.37.1/en/model_doc/auto#transformers.AutoTokenizer), and [bert-based-uncased](https://huggingface.co/bert-base-uncased) to tokenize `text` in `TextDocumentWithLabeledSpansAndBinaryRelations` (see [document type](https://github.com/ChristophAlt/pytorch-ie/blob/main/src/pytorch_ie/documents.py)).
145
 
146
  #### Relation argument (outer) token distance per label
147
 
@@ -354,7 +355,7 @@ python src/evaluate_documents.py dataset=abstrct_base metric=count_text_tokens
354
 
355
  ### Curation Rationale
356
 
357
- "\[D\]espite its natural employment in healthcare applications, only few approaches have applied AM methods to this kind
358
  of text, and their contribution is limited to the detection
359
  of argument components, disregarding the more complex phase of
360
  predicting the relations among them. In addition, no huge annotated
@@ -373,7 +374,7 @@ Extended from the previous dataset in [Mayer et al. 2018](https://webusers.i3s.u
373
 
374
  #### Who are the source language producers?
375
 
376
- \[More Information Needed\]
377
 
378
  ### Annotations
379
 
@@ -405,7 +406,7 @@ Two annotators with background in computational linguistics. No information was
405
 
406
  ### Personal and Sensitive Information
407
 
408
- \[More Information Needed\]
409
 
410
  ## Considerations for Using the Data
411
 
@@ -426,17 +427,17 @@ scale." (p. 2114)
426
 
427
  ### Discussion of Biases
428
 
429
- \[More Information Needed\]
430
 
431
  ### Other Known Limitations
432
 
433
- \[More Information Needed\]
434
 
435
  ## Additional Information
436
 
437
  ### Dataset Curators
438
 
439
- \[More Information Needed\]
440
 
441
  ### Licensing Information
442
 
 
15
  ```python
16
  from pie_datasets import load_dataset
17
  from pie_datasets.builders.brat import BratDocumentWithMergedSpans
18
+ from pie_modules.documents import TextDocumentWithLabeledSpansAndBinaryRelations
19
 
20
  # load default version
21
  dataset = load_dataset("pie/abstrct")
22
  assert isinstance(dataset["neoplasm_train"][0], BratDocumentWithMergedSpans)
23
 
24
  # if required, normalize the document type (see section Document Converters below)
25
+ dataset_converted = dataset.to_document_type("pie_modules.documents.TextDocumentWithLabeledSpansAndBinaryRelations")
26
  assert isinstance(dataset_converted["neoplasm_train"][0], TextDocumentWithLabeledSpansAndBinaryRelations)
27
 
28
  # get first relation in the first document
 
57
 
58
  The dataset provides document converters for the following target document types:
59
 
60
+ - `pie_modules.documents.TextDocumentWithLabeledSpansAndBinaryRelations`
61
  - `LabeledSpans`, converted from `BratDocumentWithMergedSpans`'s `spans`
62
  - labels: `MajorClaim`, `Claim`, `Premise`
63
  - `BinraryRelations`, converted from `BratDocumentWithMergedSpans`'s `relations`
64
+ - labels: `Support`, `Partial-Attack`, `Attack`
65
 
66
+ See [here](https://github.com/ArneBinder/pie-modules/blob/main/src/pie_modules/documents.py) for the document type definitions.
67
 
68
  ### Data Splits
69
 
 
93
 
94
  - `MajorClaim` are more general/concluding `claim`'s, which is supported by more specific claims
95
  - `Claim` is a concluding statement made by the author about the outcome of the study. Claims only points to other claims.
96
+ - `Premise` (a.k.a. evidence) is an observation or measurement in the study, which supports or attacks another argument component, usually a `claim`. They are observed facts, and therefore credible without further justifications, as this is the ground truth the argumentation is based on.
97
 
98
  (Mayer et al. 2020, p.2110)
99
 
 
118
 
119
  #### Example
120
 
121
+ ![abstr-sam1.png](img/abstrct_neoplasm-train_6.png)
122
+ ![abstr-sam2.png](img/abstrct_neoplasm-train_67.png)
123
 
124
  ### Collected Statistics after Document Conversion
125
 
 
142
  revision: 277dc703fd78614635e86fe57c636b54931538b2
143
  ```
144
 
145
+ For token based metrics, this uses `bert-base-uncased` from `transformer.AutoTokenizer` (see [AutoTokenizer](https://huggingface.co/docs/transformers/v4.37.1/en/model_doc/auto#transformers.AutoTokenizer), and [bert-based-uncased](https://huggingface.co/bert-base-uncased) to tokenize `text` in `TextDocumentWithLabeledSpansAndBinaryRelations` (see [document type](https://github.com/ArneBinder/pie-modules/blob/main/src/pie_modules/documents.py)).
146
 
147
  #### Relation argument (outer) token distance per label
148
 
 
355
 
356
  ### Curation Rationale
357
 
358
+ "[D]espite its natural employment in healthcare applications, only few approaches have applied AM methods to this kind
359
  of text, and their contribution is limited to the detection
360
  of argument components, disregarding the more complex phase of
361
  predicting the relations among them. In addition, no huge annotated
 
374
 
375
  #### Who are the source language producers?
376
 
377
+ [More Information Needed]
378
 
379
  ### Annotations
380
 
 
406
 
407
  ### Personal and Sensitive Information
408
 
409
+ [More Information Needed]
410
 
411
  ## Considerations for Using the Data
412
 
 
427
 
428
  ### Discussion of Biases
429
 
430
+ [More Information Needed]
431
 
432
  ### Other Known Limitations
433
 
434
+ [More Information Needed]
435
 
436
  ## Additional Information
437
 
438
  ### Dataset Curators
439
 
440
+ [More Information Needed]
441
 
442
  ### Licensing Information
443
 
abstrct.py CHANGED
@@ -1,4 +1,4 @@
1
- from pytorch_ie.documents import TextDocumentWithLabeledSpansAndBinaryRelations
2
 
3
  from pie_datasets.builders import BratBuilder, BratConfig
4
  from pie_datasets.builders.brat import BratDocumentWithMergedSpans
 
1
+ from pie_modules.documents import TextDocumentWithLabeledSpansAndBinaryRelations
2
 
3
  from pie_datasets.builders import BratBuilder, BratConfig
4
  from pie_datasets.builders.brat import BratDocumentWithMergedSpans
requirements.txt CHANGED
@@ -1 +1,2 @@
1
- pie-datasets>=0.4.0,<0.11.0
 
 
1
+ pie-datasets>=0.10.11,<0.11.0
2
+ pie-modules>=0.15.9,<0.16.0