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
786c1a0f
Commit
786c1a0f
authored
3 years ago
by
Charlotte Mauvezin
Browse files
Options
Downloads
Patches
Plain Diff
Better parser
parent
a3752ba3
No related branches found
No related tags found
1 merge request
!13
Better parser
Pipeline
#103832
passed
3 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
demo/demo_annot.bio
+0
-82
0 additions, 82 deletions
demo/demo_annot.bio
demo/demo_predict.bio
+0
-81
0 additions, 81 deletions
demo/demo_predict.bio
nerval/evaluate.py
+32
-37
32 additions, 37 deletions
nerval/evaluate.py
with
32 additions
and
200 deletions
demo/demo_annot.bio
deleted
100644 → 0
+
0
−
82
View file @
a3752ba3
Césaire B-PER
Alphonse I-PER
Garon I-PER
marraine O
Adeline B-PER
Dionne I-PER
, O
soussignés O
Lecture O
faite O
Adéline O
Dionne O
Arsène O
Côté O
Arpin O
R O
Le O
onze B-DAT
aout I-DAT
mil I-DAT
neuf I-DAT
cent I-DAT
un I-DAT
nous O
prêtre O
soussigné O
avons O
baptisé O
Marie B-PER
Luce I-PER
Louise I-PER
, O
née O
la B-DAT
veille I-DAT
, O
fille O
légitime O
de O
Carmel B-PER
Côté I-PER
, O
cordonnier B-OCC
, O
pré O
- O
sent O
, O
déclarant O
ne O
savoir O
signer O
, O
et O
de O
Eugé B-PER
nie I-PER
Fréchette I-PER
, O
de O
cette B-LOC
paroisse I-LOC
. O
Parrain O
Napoléon B-PER
Fréchette I-PER
, O
marraine O
Adeline B-PER
Tremblay I-PER
, O
soussignés O
, O
de O
Ste B-LOC
Luce I-LOC
, O
Lec O
- O
ture O
faite O
. O
This diff is collapsed.
Click to expand it.
demo/demo_predict.bio
deleted
100644 → 0
+
0
−
81
View file @
a3752ba3
Césaire B-PER
Alphonse O
Garon B-PER
marraine O
Adeline B-PER
Dionne I-PER
, O
soussignés O
Lecture O
faite O
Adéline O
Dionne O
Arsène O
Côté O
Arpin O
R O
Le O
onze B-DAT
aout I-DAT
mil I-DAT
neuf I-DAT
cent I-DAT
un O
nous O
pretre O
soussigné O
avons O
baptisé O
Marie B-PER
Luce I-PER
Louise I-PER
, O
née O
la B-DAT
veille I-DAT
, O
fille O
légitime O
de O
Carmel B-PER
Côté I-PER
, O
cordonnier B-OCC
, O
pré O
- O
sent O
, O
déclarant O
ne O
savoir O
signer O
, O
et O
de O
Eugé B-PER
nie I-PER
Fréchette I-PER
, O
de O
cette B-LOC
paroisse I-LOC
. O
Parrain O
Napoléon B-PER
Fréchette I-PER
, O
marraine O
Adéline B-PER
Tremblay I-PER
, O
sousignés O
, O
de O
St B-LOC
. I-LOC
Luce O
, O
Lec O
ture O
faite O
This diff is collapsed.
Click to expand it.
nerval/evaluate.py
+
32
−
37
View file @
786c1a0f
...
...
@@ -624,36 +624,24 @@ def main():
logging
.
basicConfig
(
level
=
logging
.
INFO
)
parser
=
argparse
.
ArgumentParser
(
description
=
"
Compute score of NER on predict.
"
)
parser
.
add_argument
(
"
-m
"
,
"
--multiple
"
,
help
=
"
Single if 1, multiple 2
"
,
type
=
int
,
required
=
True
,
)
parser
.
add_argument
(
group
=
parser
.
add_mutually_exclusive_group
()
group
.
add_argument
(
"
-a
"
,
"
--annot
"
,
help
=
"
Annotation in BIO format.
"
,
)
parser
.
add_argument
(
"
-p
"
,
"
--predict
"
,
help
=
"
Prediction in BIO format.
"
,
)
parser
.
add_argument
(
"
-t
"
,
"
--threshold
"
,
help
=
"
Set a distance threshold for the match between gold and predicted entity.
"
,
default
=
THRESHOLD
,
type
=
threshold_float_type
,
)
parser
.
add_argument
(
group
.
add_argument
(
"
-c
"
,
"
--csv
"
,
help
=
"
Csv with the correlation between the annotation bio files and the predict bio files
"
,
type
=
Path
,
)
parser
.
add_argument
(
"
-p
"
,
"
--predict
"
,
help
=
"
Prediction in BIO format.
"
,
)
parser
.
add_argument
(
"
-f
"
,
"
--folder
"
,
...
...
@@ -666,25 +654,32 @@ def main():
help
=
"
Print only the recap if False
"
,
action
=
"
store_false
"
,
)
parser
.
add_argument
(
"
-t
"
,
"
--threshold
"
,
help
=
"
Set a distance threshold for the match between gold and predicted entity.
"
,
default
=
THRESHOLD
,
type
=
threshold_float_type
,
)
args
=
parser
.
parse_args
()
if
args
.
multiple
==
1
or
args
.
multiple
==
2
:
if
args
.
multiple
==
2
:
if
not
args
.
folder
:
raise
argparse
.
ArgumentError
(
args
.
folder
,
"
-f must be given if -m is 2
"
)
if
not
args
.
csv
:
raise
argparse
.
ArgumentError
(
args
.
folder
,
"
-c must be given if -m is 2
"
)
if
args
.
folder
and
args
.
csv
:
run_multiple
(
args
.
csv
,
args
.
folder
,
args
.
threshold
,
args
.
verbose
)
if
args
.
multiple
==
1
:
if
not
args
.
annot
:
raise
argparse
.
ArgumentError
(
args
.
folder
,
"
-a must be given if -m is 1
"
)
if
not
args
.
predict
:
raise
argparse
.
ArgumentError
(
args
.
folder
,
"
-p must be given if -m is 1
"
)
if
args
.
annot
and
args
.
predict
:
run
(
args
.
annot
,
args
.
predict
,
args
.
threshold
,
args
.
verbose
)
if
args
.
annot
:
if
not
args
.
predict
:
raise
argparse
.
ArgumentError
(
args
.
folder
,
"
You need to specify the path to a predict file
"
)
if
args
.
annot
and
args
.
predict
:
run
(
args
.
annot
,
args
.
predict
,
args
.
threshold
,
args
.
verbose
)
elif
args
.
csv
:
if
not
args
.
csv
:
raise
argparse
.
ArgumentError
(
args
.
folder
,
"
You need to specify the path to a folder of bio files
"
)
if
args
.
folder
and
args
.
csv
:
run_multiple
(
args
.
csv
,
args
.
folder
,
args
.
threshold
,
args
.
verbose
)
else
:
raise
argparse
.
ArgumentTypeError
(
"
Value has to be 1 or 2
"
)
raise
Exception
(
"
You need to specify the argument of input file
"
)
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
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