Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nerval
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Named Entity Recognition
nerval
Commits
e5e4b5d2
Commit
e5e4b5d2
authored
3 years ago
by
Blanche Miret
Committed by
Bastien Abadie
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Build nerval v1
parent
fb874bf2
No related branches found
No related tags found
1 merge request
!1
Build nerval v1
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_predict.bio
+9
-0
9 additions, 0 deletions
tests/test_predict.bio
tests/test_run.py
+27
-0
27 additions, 0 deletions
tests/test_run.py
with
36 additions
and
0 deletions
tests/test_predict.bio
0 → 100644
+
9
−
0
View file @
e5e4b5d2
G*rard B-PER
de I-PER
*N*erval I-PER
bo*rn O
in O
Paris B-***
in O
1833 B-DAT
*. O
This diff is collapsed.
Click to expand it.
tests/test_run.py
0 → 100644
+
27
−
0
View file @
e5e4b5d2
import
pytest
from
nerval
import
evaluate
FAKE_ANNOT_BIO
=
"
test_annot.bio
"
FAKE_PREDICT_BIO
=
"
test_predict.bio
"
expected_scores
=
{
'
***
'
:
{
'
P
'
:
0.0
,
'
R
'
:
None
,
'
F1
'
:
None
},
'
DAT
'
:
{
'
P
'
:
0.0
,
'
R
'
:
0.0
,
'
F1
'
:
0
},
'
All
'
:
{
'
P
'
:
0.3333333333333333
,
'
R
'
:
0.3333333333333333
,
'
F1
'
:
0.3333333333333333
},
'
PER
'
:
{
'
P
'
:
1.0
,
'
R
'
:
1.0
,
'
F1
'
:
1.0
},
'
LOC
'
:
{
'
P
'
:
None
,
'
R
'
:
0.0
,
'
F1
'
:
None
}
}
@pytest.mark.parametrize
(
"
test_input, expected
"
,
[((
FAKE_ANNOT_BIO
,
FAKE_PREDICT_BIO
),
expected_scores
)]
)
def
test_run
(
test_input
,
expected
)
:
assert
evaluate
.
run
(
*
test_input
)
==
expected
def
test_run_empty_bio
()
:
with
pytest
.
raises
(
Exception
)
:
evaluate
.
run
(
EMPTY_BIO
,
EMPTY_BIO
)
def
test_run_empty_entry
()
:
with
pytest
.
raises
(
TypeError
)
:
evaluate
.
run
(
None
,
None
)
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment