Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon_data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Franck Dary
macaon_data
Commits
ada1cdb1
Commit
ada1cdb1
authored
3 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Added colnames in eval script for error comparison
parent
d9968e9f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/conll18_ud_eval.py
+8
-0
8 additions, 0 deletions
scripts/conll18_ud_eval.py
with
8 additions
and
0 deletions
scripts/conll18_ud_eval.py
+
8
−
0
View file @
ada1cdb1
...
...
@@ -109,6 +109,9 @@ index2col = {}
metric2colname
=
{
"
UPOS
"
:
"
UPOS
"
,
"
Lemmas
"
:
"
LEMMA
"
,
"
UFeats
"
:
"
FEATS
"
,
"
UAS
"
:
"
HEAD
"
,
"
LAS
"
:
"
DEPREL
"
,
}
defaultColumns
=
{
...
...
@@ -632,6 +635,9 @@ def evaluate_wrapper(args) :
################################################################################
class
Error
:
def
__init__
(
self
,
gold_file
,
system_file
,
gold_word
,
system_word
,
metric
)
:
if
metric
not
in
metric2colname
:
raise
(
Exception
(
"
Metric
'
%s
'
don
'
t have corresponding colname in
'
%s
'"
%
(
metric
,
metric2colname
.
keys
())))
self
.
gold
=
gold_word
self
.
pred
=
system_word
self
.
gold_sentence
=
gold_file
.
words
[
gold_file
.
sentences_words
[
self
.
gold
.
sentence
].
start
:
gold_file
.
sentences_words
[
self
.
gold
.
sentence
].
end
]
...
...
@@ -696,6 +702,8 @@ class ErrorType :
################################################################################
def
compute_errors
(
gold_file
,
system_file
,
evaluation
,
metric
)
:
errors
=
Errors
(
metric
)
if
metric
not
in
evaluation
:
raise
(
Exception
(
"
metric
'
%s
'
not in evaluation :
'
%s
'"
%
(
metric
,
evaluation
.
keys
())))
for
alignment_word
in
evaluation
[
metric
][
1
]
:
gold
=
alignment_word
.
gold_word
pred
=
alignment_word
.
system_word
...
...
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