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

NER Benchmark Script #148

Merged
merged 19 commits into from
Jul 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
19 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
Update annotation test for new stopwords
bgyori committed Jul 26, 2024
commit c05e87282b64805783a67d23b43ea1c022fae4d1
11 changes: 4 additions & 7 deletions gilda/tests/test_ner.py
Original file line number Diff line number Diff line change
@@ -12,22 +12,19 @@ def test_annotate():
assert isinstance(annotations, list)

# Check that we get 7 annotations
assert len(annotations) == 7
assert len(annotations) == 4

# Check that the annotations are for the expected words
assert tuple(a.text for a in annotations) == (
'protein', 'BRAF', 'kinase', 'BRAF', 'gene', 'BRAF', 'protein')
'BRAF', 'kinase', 'BRAF', 'BRAF')

# Check that the spans are correct
expected_spans = ((4, 11), (12, 16), (22, 28), (30, 34), (40, 44),
(46, 50), (56, 63))
expected_spans = ((12, 16), (22, 28), (30, 34), (46, 50))
actual_spans = tuple((a.start, a.end) for a in annotations)
assert actual_spans == expected_spans

# Check that the curies are correct
expected_curies = ("CHEBI:36080", "hgnc:1097", "mesh:D010770",
"hgnc:1097", "mesh:D005796", "hgnc:1097",
"CHEBI:36080")
expected_curies = ("hgnc:1097", "mesh:D010770", "hgnc:1097", "hgnc:1097")
actual_curies = tuple(a.matches[0].term.get_curie() for a in annotations)
assert actual_curies == expected_curies