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
- abstrct.py +1 -1
- requirements.txt +1 -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
|
| 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("
|
| 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 |
-
- `
|
| 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-
|
| 67 |
|
| 68 |
### Data Splits
|
| 69 |
|
|
@@ -142,7 +142,7 @@ input:
|
|
| 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-
|
| 146 |
|
| 147 |
#### Relation argument (outer) token distance per label
|
| 148 |
|
|
|
|
| 15 |
```python
|
| 16 |
from pie_datasets import load_dataset
|
| 17 |
from pie_datasets.builders.brat import BratDocumentWithMergedSpans
|
| 18 |
+
from pie_documents.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_documents.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_documents.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-documents/blob/main/src/pie_documents/documents.py) for the document type definitions.
|
| 67 |
|
| 68 |
### Data Splits
|
| 69 |
|
|
|
|
| 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-documents/blob/main/src/pie_documents/documents.py)).
|
| 146 |
|
| 147 |
#### Relation argument (outer) token distance per label
|
| 148 |
|
abstrct.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from
|
| 2 |
|
| 3 |
from pie_datasets.builders import BratBuilder, BratConfig
|
| 4 |
from pie_datasets.builders.brat import BratDocumentWithMergedSpans
|
|
|
|
| 1 |
+
from pie_documents.documents import TextDocumentWithLabeledSpansAndBinaryRelations
|
| 2 |
|
| 3 |
from pie_datasets.builders import BratBuilder, BratConfig
|
| 4 |
from pie_datasets.builders.brat import BratDocumentWithMergedSpans
|
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
|