use pie-documents 0.1.0
Browse filesfrom https://github.com/ArneBinder/pie-datasets/pull/209 (and https://github.com/ArneBinder/pie-datasets/pull/211), also see https://github.com/ArneBinder/pie-documents/releases/tag/v0.1.0
- README.md +5 -5
- aae2.py +3 -3
- requirements.txt +1 -1
README.md
CHANGED
|
@@ -9,7 +9,7 @@ Therefore, the `aae2` dataset as described here follows the data structure from
|
|
| 9 |
```python
|
| 10 |
from pie_datasets import load_dataset
|
| 11 |
from pie_datasets.builders.brat import BratDocumentWithMergedSpans
|
| 12 |
-
from
|
| 13 |
|
| 14 |
# load default version
|
| 15 |
dataset = load_dataset("pie/aae2")
|
|
@@ -102,7 +102,7 @@ See further description in Stab & Gurevych 2017, p.627 and the [annotation guide
|
|
| 102 |
|
| 103 |
The dataset provides document converters for the following target document types:
|
| 104 |
|
| 105 |
-
- `
|
| 106 |
- `labeled_spans`: `LabeledSpan` annotations, converted from `BratDocumentWithMergedSpans`'s `spans`
|
| 107 |
- labels: `MajorClaim`, `Claim`, `Premise`
|
| 108 |
- `binary_relations`: `BinaryRelation` annotations, converted from `BratDocumentWithMergedSpans`'s `relations`
|
|
@@ -114,13 +114,13 @@ The dataset provides document converters for the following target document types
|
|
| 114 |
- build a `supports` or `attacks` relation from each `Claim` to every `MajorClaim`
|
| 115 |
- no relations between each `MajorClaim`
|
| 116 |
- labels: `supports`, `attacks`, and `semantically_same` if `connect_first`
|
| 117 |
-
- `
|
| 118 |
- `labeled_spans`, as above
|
| 119 |
- `binary_relations`, as above
|
| 120 |
- `labeled_partitions`, `LabeledSpan` annotations, created from splitting `BratDocumentWithMergedSpans`'s `text` at new lines (`\n`).
|
| 121 |
- every partition is labeled as `paragraph`
|
| 122 |
|
| 123 |
-
See [here](https://github.com/ArneBinder/pie-
|
| 124 |
definitions.
|
| 125 |
|
| 126 |
#### Relation Label Statistics after Document Conversion
|
|
@@ -164,7 +164,7 @@ input:
|
|
| 164 |
revision: 1015ee38bd8a36549b344008f7a49af72956a7fe
|
| 165 |
```
|
| 166 |
|
| 167 |
-
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-
|
| 168 |
|
| 169 |
For relation-label statistics, we collect those from the default relation conversion method, i.e., `connect_first`, resulting in three distinct relation labels.
|
| 170 |
|
|
|
|
| 9 |
```python
|
| 10 |
from pie_datasets import load_dataset
|
| 11 |
from pie_datasets.builders.brat import BratDocumentWithMergedSpans
|
| 12 |
+
from pie_documents.documents import TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions
|
| 13 |
|
| 14 |
# load default version
|
| 15 |
dataset = load_dataset("pie/aae2")
|
|
|
|
| 102 |
|
| 103 |
The dataset provides document converters for the following target document types:
|
| 104 |
|
| 105 |
+
- `pie_documents.documents.TextDocumentWithLabeledSpansAndBinaryRelations` with layers:
|
| 106 |
- `labeled_spans`: `LabeledSpan` annotations, converted from `BratDocumentWithMergedSpans`'s `spans`
|
| 107 |
- labels: `MajorClaim`, `Claim`, `Premise`
|
| 108 |
- `binary_relations`: `BinaryRelation` annotations, converted from `BratDocumentWithMergedSpans`'s `relations`
|
|
|
|
| 114 |
- build a `supports` or `attacks` relation from each `Claim` to every `MajorClaim`
|
| 115 |
- no relations between each `MajorClaim`
|
| 116 |
- labels: `supports`, `attacks`, and `semantically_same` if `connect_first`
|
| 117 |
+
- `pie_documents.documents.TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions` with layers:
|
| 118 |
- `labeled_spans`, as above
|
| 119 |
- `binary_relations`, as above
|
| 120 |
- `labeled_partitions`, `LabeledSpan` annotations, created from splitting `BratDocumentWithMergedSpans`'s `text` at new lines (`\n`).
|
| 121 |
- every partition is labeled as `paragraph`
|
| 122 |
|
| 123 |
+
See [here](https://github.com/ArneBinder/pie-documents/blob/main/src/pie_documents/documents.py) for the document type
|
| 124 |
definitions.
|
| 125 |
|
| 126 |
#### Relation Label Statistics after Document Conversion
|
|
|
|
| 164 |
revision: 1015ee38bd8a36549b344008f7a49af72956a7fe
|
| 165 |
```
|
| 166 |
|
| 167 |
+
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-documents/blob/main/src/pie_documents/documents.py)).
|
| 168 |
|
| 169 |
For relation-label statistics, we collect those from the default relation conversion method, i.e., `connect_first`, resulting in three distinct relation labels.
|
| 170 |
|
aae2.py
CHANGED
|
@@ -2,9 +2,9 @@ import os
|
|
| 2 |
from typing import Dict
|
| 3 |
|
| 4 |
import pandas as pd
|
| 5 |
-
from
|
| 6 |
-
from
|
| 7 |
-
from
|
| 8 |
TextDocumentWithLabeledSpansAndBinaryRelations,
|
| 9 |
TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions,
|
| 10 |
)
|
|
|
|
| 2 |
from typing import Dict
|
| 3 |
|
| 4 |
import pandas as pd
|
| 5 |
+
from pie_documents.annotations import BinaryRelation
|
| 6 |
+
from pie_documents.document.processing import RegexPartitioner
|
| 7 |
+
from pie_documents.documents import (
|
| 8 |
TextDocumentWithLabeledSpansAndBinaryRelations,
|
| 9 |
TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions,
|
| 10 |
)
|
requirements.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
pie-datasets>=0.10.11,<0.12.0
|
| 2 |
-
pie-
|
|
|
|
| 1 |
pie-datasets>=0.10.11,<0.12.0
|
| 2 |
+
pie-documents>=0.1.0,<0.2.0
|