Skip to content

Commit

Permalink
revert: 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 69e289b commit 2d6d1d0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
28 changes: 12 additions & 16 deletions poetry.lock

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

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

[tool.poetry.dependencies]
python = "^3.9"
#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-ie = ">=0.31.2,<0.32.0"
pytorch-lightning = "^2.1.0"
torchmetrics = "^1"
# >=4.35 because of BartModelWithDecoderPositionIds, <4.37 because of generation config
Expand Down
6 changes: 3 additions & 3 deletions tests/taskmodules/test_pointer_network_for_end2end_re.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,9 @@ 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].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)
doc_with_predictions: ExampleDocument = docs_with_predictions[0]
assert set(doc_with_predictions.entities.predictions) == set(doc_with_predictions.entities)
assert set(doc_with_predictions.relations.predictions) == set(doc_with_predictions.relations)


@pytest.fixture()
Expand Down

0 comments on commit 2d6d1d0

Please sign in to comment.