Skip to content

Commit

Permalink
use deduplicate_annotations() in test
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBinder committed Nov 13, 2024
1 parent 2a9b2d6 commit 69e289b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
28 changes: 16 additions & 12 deletions poetry.lock

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

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

[tool.poetry.dependencies]
python = "^3.9"
pytorch-ie = ">=0.31.2,<0.32.0"
#pytorch-ie = ">=0.31.4,<0.32.0"
# install from branch from https://github.com/ArneBinder/pytorch-ie/pull/436
pytorch-ie = { git = "https://github.com/ArneBinder/pytorch-ie", branch = "document/deduplicate_annotations" }
pytorch-lightning = "^2.1.0"
torchmetrics = "^1"
# >=4.35 because of BartModelWithDecoderPositionIds, <4.37 because of generation config
Expand Down
2 changes: 1 addition & 1 deletion tests/taskmodules/test_pointer_network_for_end2end_re.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def test_decode_with_add_reversed_relations():
task_outputs = [task_encoding.targets for task_encoding in task_encodings]
docs_with_predictions = taskmodule.decode(task_encodings, task_outputs)
assert len(docs_with_predictions) == 1
doc_with_predictions: ExampleDocument = docs_with_predictions[0]
doc_with_predictions: ExampleDocument = docs_with_predictions[0].deduplicate_annotations()
assert list(doc_with_predictions.entities.predictions) == list(doc_with_predictions.entities)
assert list(doc_with_predictions.relations.predictions) == list(doc_with_predictions.relations)

Expand Down

0 comments on commit 69e289b

Please sign in to comment.