Skip to content

Commit

Permalink
Merge pull request #70 from ArneBinder/import_pie_models
Browse files Browse the repository at this point in the history
import `pie-models` instead of `pytorch-ie`
  • Loading branch information
ArneBinder authored Nov 26, 2023
2 parents 83fb46f + 80f35b7 commit 9bc679d
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 2,315 deletions.
4 changes: 2 additions & 2 deletions dataset_builders/pie/cdcp/cdcp.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import dataclasses
import logging
from typing import Any, Callable, Dict, List, Optional
from typing import Any, Dict, List, Optional

import datasets
from pie_models.document.processing.text_span_trimmer import trim_text_spans
from pytorch_ie.annotations import BinaryRelation, LabeledSpan
from pytorch_ie.core import Annotation, AnnotationList, annotation_field
from pytorch_ie.documents import (
Expand All @@ -11,7 +12,6 @@
)

from pie_datasets import GeneratorBasedBuilder
from pie_datasets.document.processing.text_span_trimmer import trim_text_spans

log = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions dataset_builders/pie/scidtb_argmin/scidtb_argmin.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import dataclasses
import logging
from typing import Any, Callable, Dict, List, Optional, Tuple
from typing import Any, Dict, List, Tuple

import datasets
from pie_models.document.processing import token_based_document_to_text_based
from pytorch_ie.annotations import BinaryRelation, LabeledSpan
from pytorch_ie.core import AnnotationList, Document, annotation_field
from pytorch_ie.core import AnnotationList, annotation_field
from pytorch_ie.documents import (
TextDocumentWithLabeledSpansAndBinaryRelations,
TokenBasedDocument,
)
from pytorch_ie.utils.span import bio_tags_to_spans

from pie_datasets import GeneratorBasedBuilder
from pie_datasets.document.processing import token_based_document_to_text_based

log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion dataset_builders/pie/tacred/tacred.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Any, Dict, Optional

import datasets
from pie_models.document.processing import token_based_document_to_text_based
from pytorch_ie.annotations import BinaryRelation, LabeledSpan
from pytorch_ie.core import Annotation, AnnotationList, annotation_field
from pytorch_ie.documents import (
Expand All @@ -10,7 +11,6 @@
)

from pie_datasets import GeneratorBasedBuilder
from pie_datasets.document.processing import token_based_document_to_text_based


@dataclass(eq=True, frozen=True)
Expand Down
35 changes: 31 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [

[tool.poetry.dependencies]
python = "^3.9"
pytorch-ie = ">=0.29.1,<0.30.0"
pie-models = "^0.7.6"
datasets = "^2.14"
# this was manually added because we get a conflict with pyarrow otherwise
pyarrow = "^13"
Expand Down
8 changes: 0 additions & 8 deletions src/pie_datasets/document/processing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
from .generic import Caster, Converter, Pipeline
from .regex_partitioner import RegexPartitioner
from .relation_argument_sorter import RelationArgumentSorter
from .text_span_trimmer import TextSpanTrimmer
from .tokenization import (
text_based_document_to_token_based,
token_based_document_to_text_based,
tokenize_document,
)
217 changes: 0 additions & 217 deletions src/pie_datasets/document/processing/regex_partitioner.py

This file was deleted.

Loading

0 comments on commit 9bc679d

Please sign in to comment.