Skip to content

Commit

Permalink
use GeneratorBasedBuilder from pie_datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBinder committed Nov 7, 2023
1 parent 76ab4e6 commit 5cfc009
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions dataset_builders/pie/brat/brat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
from typing import Any, Dict, List, Optional, Tuple, Union

import datasets
import pytorch_ie
from pytorch_ie.annotations import (
BinaryRelation,
LabeledMultiSpan,
LabeledSpan,
_post_init_single_label,
)
from pytorch_ie.annotations import BinaryRelation, LabeledMultiSpan, LabeledSpan
from pytorch_ie.core import Annotation, AnnotationList, annotation_field
from pytorch_ie.documents import TextBasedDocument

from pie_datasets import GeneratorBasedBuilder

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -288,7 +284,7 @@ def __init__(self, merge_fragmented_spans: bool = False, **kwargs):
self.merge_fragmented_spans = merge_fragmented_spans


class BratDatasetLoader(pytorch_ie.data.builder.GeneratorBasedBuilder):
class BratDatasetLoader(GeneratorBasedBuilder):
# this requires https://github.com/ChristophAlt/pytorch-ie/pull/288
DOCUMENT_TYPES = {
"default": BratDocument,
Expand Down

0 comments on commit 5cfc009

Please sign in to comment.