Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lambo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
lambo
Commits
b522742d
Commit
b522742d
authored
Mar 15, 2024
by
piotrmp
Browse files
Options
Downloads
Patches
Plain Diff
Tweaks in the evaluation script.
parent
0580d103
No related branches found
No related tags found
No related merge requests found
Changes
1
Show 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
...
...
@@ -10,8 +10,8 @@ from lambo.segmenter.lambo import Lambo
from
lambo.segmenter.spacy
import
Spacy_segmenter
if
__name__
==
'
__main__
'
:
modelpath
=
Path
.
home
()
/
'
PATH-TO/models/
vanilla
/
'
modelPpath
=
Path
.
home
()
/
'
PATH-TO/models/full
'
modelpath
=
Path
.
home
()
/
'
PATH-TO/models/
full211-s
/
'
modelPpath
=
Path
.
home
()
/
'
PATH-TO/models/full
213-withunk/
'
tmp_path
=
Path
.
home
()
/
'
PATH-TO/out/tmp.conllu
'
treebanks
=
[
line
.
split
(
'
'
)[
0
]
for
line
in
...
...
@@ -22,19 +22,19 @@ if __name__ == '__main__':
# Load spaCy segmenter as baseline
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
))
for
treebank
in
treebanks
:
# Load LAMBO segmenter
lambo
=
Lambo
.
from_path
(
modelpath
,
treebank
)
# Load
pretrain
ed LAMBO segmenter
# Load
modifi
ed LAMBO segmenter
lamboP
=
Lambo
.
from_path
(
modelPpath
,
treebank
)
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
'
))
if
len
(
text_file
)
!=
1
:
continue
...
...
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