Skip to content

Commit

Permalink
remove pie-utils from dependencies and update pytorch-ie (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBinder authored Nov 14, 2023
1 parent 4b5cf01 commit 2e13064
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
6 changes: 1 addition & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# --------- pytorch-ie --------- #
pytorch-ie>=0.28.0,<0.29.0
pytorch-ie>=0.28.0,<0.30.0
pie-datasets>=0.3.1,<0.4.0
# pie-utils provides some useful helper methods for pytorch-ie,
# e.g. document processors or span utils (convert span annotations
# to sequence encodings such as BIO, IO or BIOUL, and back).
git+https://github.com/ArneBinder/[email protected]

# --------- hydra --------- #
hydra-core>=1.3.0
Expand Down
13 changes: 6 additions & 7 deletions src/pipeline/ner_re_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from functools import partial
from typing import Callable, Dict, List, Optional, Sequence, TypeVar

from pie_utils.document.processors import CandidateRelationAdder
from pytorch_ie import AutoPipeline
from pytorch_ie.core import Document

Expand Down Expand Up @@ -170,12 +169,12 @@ def __call__(self, documents: Sequence[Document], inplace: bool = False):
layer_names=["entities"],
**self.processor_kwargs.get("use_predicted_entities", {}),
),
"create_candidate_relations": partial(
process_documents,
processor=CandidateRelationAdder(
**self.processor_kwargs.get("create_candidate_relations", {})
),
),
# "create_candidate_relations": partial(
# process_documents,
# processor=CandidateRelationAdder(
# **self.processor_kwargs.get("create_candidate_relations", {})
# ),
# ),
"re_pipeline": AutoPipeline.from_pretrained(
self.re_model_path, **self.processor_kwargs.get("re_pipeline", {})
),
Expand Down

0 comments on commit 2e13064

Please sign in to comment.