Commit
·
0fa8689
1
Parent(s):
cf7b17b
upgrade to pie-datasets 0.3.0
Browse files- conll2003.py +3 -2
- requirements.txt +1 -0
conll2003.py
CHANGED
|
@@ -1,19 +1,20 @@
|
|
| 1 |
from dataclasses import dataclass
|
| 2 |
|
| 3 |
import datasets
|
| 4 |
-
import pytorch_ie.data.builder
|
| 5 |
from pytorch_ie.annotations import LabeledSpan
|
| 6 |
from pytorch_ie.core import AnnotationList, annotation_field
|
| 7 |
from pytorch_ie.documents import TextDocument, TextDocumentWithLabeledSpans
|
| 8 |
from pytorch_ie.utils.span import tokens_and_tags_to_text_and_labeled_spans
|
| 9 |
|
|
|
|
|
|
|
| 10 |
|
| 11 |
@dataclass
|
| 12 |
class CoNLL2003Document(TextDocument):
|
| 13 |
entities: AnnotationList[LabeledSpan] = annotation_field(target="text")
|
| 14 |
|
| 15 |
|
| 16 |
-
class Conll2003(
|
| 17 |
DOCUMENT_TYPE = CoNLL2003Document
|
| 18 |
|
| 19 |
BASE_DATASET_PATH = "conll2003"
|
|
|
|
| 1 |
from dataclasses import dataclass
|
| 2 |
|
| 3 |
import datasets
|
|
|
|
| 4 |
from pytorch_ie.annotations import LabeledSpan
|
| 5 |
from pytorch_ie.core import AnnotationList, annotation_field
|
| 6 |
from pytorch_ie.documents import TextDocument, TextDocumentWithLabeledSpans
|
| 7 |
from pytorch_ie.utils.span import tokens_and_tags_to_text_and_labeled_spans
|
| 8 |
|
| 9 |
+
from pie_datasets import GeneratorBasedBuilder
|
| 10 |
+
|
| 11 |
|
| 12 |
@dataclass
|
| 13 |
class CoNLL2003Document(TextDocument):
|
| 14 |
entities: AnnotationList[LabeledSpan] = annotation_field(target="text")
|
| 15 |
|
| 16 |
|
| 17 |
+
class Conll2003(GeneratorBasedBuilder):
|
| 18 |
DOCUMENT_TYPE = CoNLL2003Document
|
| 19 |
|
| 20 |
BASE_DATASET_PATH = "conll2003"
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
pie-datasets>=0.3.0
|