ArneBinder commited on
Commit
c790c9e
·
verified ·
1 Parent(s): 02c3f3f

use pie-documents 0.1.0

Browse files

from 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

Files changed (3) hide show
  1. README.md +5 -5
  2. abstrct.py +1 -1
  3. 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 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,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
- - `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
 
@@ -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-modules/blob/main/src/pie_modules/documents.py)).
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 pie_modules.documents import TextDocumentWithLabeledSpansAndBinaryRelations
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-modules>=0.15.9,<0.16.0
 
1
  pie-datasets>=0.10.11,<0.12.0
2
+ pie-documents>=0.1.0,<0.2.0