Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule based relation #304

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix: test_relations path
Fix: modified relations assert in test_converters and test_standoff
  • Loading branch information
pidoux7 committed Jul 3, 2024
commit 6d1171016b052ca91ab6995e9cf4d60465fe552d
1 change: 1 addition & 0 deletions tests/data/test_converters.py
Original file line number Diff line number Diff line change
@@ -182,6 +182,7 @@ def test_write_standoff_dict(blank_nlp):
"label": "test",
},
],
"relations": [],
}
assert (
get_doc2dict_converter(
3 changes: 3 additions & 0 deletions tests/data/test_standoff.py
Original file line number Diff line number Diff line change
@@ -183,6 +183,7 @@ def assert_doc_read(doc):


def assert_doc_write(exported_ann_text):
print(exported_ann_text)
assert exported_ann_text == (
"T1 sosy 30 38 douleurs\n"
"A1 etat T1 test\n"
@@ -207,6 +208,8 @@ def assert_doc_write(exported_ann_text):
"A10 assertion T11 absent\n"
"T12 test label 0 378 386 anomalie\n"
"A11 assertion T12 absent\n"
"R1\tlieu Arg1:T1 Arg2:T2\n"
"R2\tlieu Arg1:T8 Arg2:T9\n"
)


4 changes: 2 additions & 2 deletions tests/pipelines/misc/test_relations.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
from pathlib import Path

import pytest
from pytest import mark
from spacy.tokens import Doc, Span

# Importation des modules après avoir ajouté le chemin
import edsnlp


@@ -15,7 +15,7 @@
)
@mark.parametrize("max_dist", [1, 45, 100])
def test_relations(use_sentences, clean_rel, proximity_method, max_dist):
dossier = "../../resources/relations/"
dossier = Path(__file__).parent.parent.parent.resolve() / "resources" / "relations"
doc_iterator = edsnlp.data.read_standoff(dossier)
corpus = list(doc_iterator)
assert len(corpus) > 0