Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lambo
Manage
Activity
Members
Labels
Plan
Issues
45
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
lambo
Commits
b522742d
Commit
b522742d
authored
1 year ago
by
piotrmp
Browse files
Options
Downloads
Patches
Plain Diff
Tweaks in the evaluation script.
parent
0580d103
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lambo/examples/run_evaluation.py
+7
-7
7 additions, 7 deletions
src/lambo/examples/run_evaluation.py
with
7 additions
and
7 deletions
src/lambo/examples/run_evaluation.py
+
7
−
7
View file @
b522742d
"""
"""
Evaluation of available model by comparing to UD gold standard
Evaluation of available model
s
by comparing to UD gold standard
"""
"""
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -10,8 +10,8 @@ from lambo.segmenter.lambo import Lambo
...
@@ -10,8 +10,8 @@ from lambo.segmenter.lambo import Lambo
from
lambo.segmenter.spacy
import
Spacy_segmenter
from
lambo.segmenter.spacy
import
Spacy_segmenter
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
modelpath
=
Path
.
home
()
/
'
PATH-TO/models/
vanilla
/
'
modelpath
=
Path
.
home
()
/
'
PATH-TO/models/
full211-s
/
'
modelPpath
=
Path
.
home
()
/
'
PATH-TO/models/full
'
modelPpath
=
Path
.
home
()
/
'
PATH-TO/models/full
213-withunk/
'
tmp_path
=
Path
.
home
()
/
'
PATH-TO/out/tmp.conllu
'
tmp_path
=
Path
.
home
()
/
'
PATH-TO/out/tmp.conllu
'
treebanks
=
[
line
.
split
(
'
'
)[
0
]
for
line
in
treebanks
=
[
line
.
split
(
'
'
)[
0
]
for
line
in
...
@@ -22,19 +22,19 @@ if __name__ == '__main__':
...
@@ -22,19 +22,19 @@ if __name__ == '__main__':
# Load spaCy segmenter as baseline
# Load spaCy segmenter as baseline
spacy
=
Spacy_segmenter
()
spacy
=
Spacy_segmenter
()
segmenters
=
{
'
spaCy
'
:
spacy
,
'
LAMBO
'
:
None
,
'
LAMBO
pretrain
ed
'
:
None
}
segmenters
=
{
'
spaCy
'
:
spacy
,
'
LAMBO
'
:
None
,
'
LAMBO
modifi
ed
'
:
None
}
print
(
'
Treebank
\t
Measure (F1)
\t
'
+
'
\t
'
.
join
(
segmenters
))
print
(
'
Treebank
\t
Measure (F1)
\t
'
+
'
\t
'
.
join
(
segmenters
))
for
treebank
in
treebanks
:
for
treebank
in
treebanks
:
# Load LAMBO segmenter
# Load LAMBO segmenter
lambo
=
Lambo
.
from_path
(
modelpath
,
treebank
)
lambo
=
Lambo
.
from_path
(
modelpath
,
treebank
)
# Load
pretrain
ed LAMBO segmenter
# Load
modifi
ed LAMBO segmenter
lamboP
=
Lambo
.
from_path
(
modelPpath
,
treebank
)
lamboP
=
Lambo
.
from_path
(
modelPpath
,
treebank
)
segmenters
[
'
LAMBO
'
]
=
lambo
segmenters
[
'
LAMBO
'
]
=
lambo
segmenters
[
'
LAMBO
pretrain
ed
'
]
=
lamboP
segmenters
[
'
LAMBO
modifi
ed
'
]
=
lamboP
data_path
=
Path
.
home
()
/
'
data
'
/
'
lambo
'
/
'
ud-treebanks-v2.
9
'
/
treebank
data_path
=
Path
.
home
()
/
'
data
'
/
'
lambo
'
/
'
ud-treebanks-v2.
11
'
/
treebank
text_file
=
list
(
data_path
.
glob
(
'
*-ud-test.txt
'
))
text_file
=
list
(
data_path
.
glob
(
'
*-ud-test.txt
'
))
if
len
(
text_file
)
!=
1
:
if
len
(
text_file
)
!=
1
:
continue
continue
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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