Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
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
Container registry
Model registry
Operate
Environments
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
combo
Commits
bbe33702
Commit
bbe33702
authored
Nov 4, 2022
by
piotrmp
Committed by
Lukasz Pszenny
May 11, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Command-line options for LAMBO segmentation.
parent
e14a6660
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
combo/main.py
+3
-2
3 additions, 2 deletions
combo/main.py
combo/predict.py
+2
-2
2 additions, 2 deletions
combo/predict.py
combo/utils/lambo.py
+1
-1
1 addition, 1 deletion
combo/utils/lambo.py
with
6 additions
and
5 deletions
combo/main.py
+
3
−
2
View file @
bbe33702
...
...
@@ -88,7 +88,8 @@ flags.DEFINE_boolean(name="silent", default=True,
flags
.
DEFINE_enum
(
name
=
"
predictor_name
"
,
default
=
"
combo-spacy
"
,
enum_values
=
[
"
combo
"
,
"
combo-spacy
"
,
"
combo-lambo
"
],
help
=
"
Use predictor with whitespace, spacy or LAMBO tokenizer.
"
)
flags
.
DEFINE_string
(
name
=
"
lambo_model_name
"
,
default
=
"
en
"
,
help
=
"
LAMBO model name (if LAMBO used for segmentation).
"
)
def
run
(
_
):
"""
Run model.
"""
...
...
@@ -175,7 +176,7 @@ def _get_predictor() -> predictors.Predictor:
)
return
predictors
.
Predictor
.
from_archive
(
archive
,
FLAGS
.
predictor_name
archive
,
FLAGS
.
predictor_name
,
extra_args
=
{
"
lambo_model_name
"
:
FLAGS
.
lambo_model_name
}
)
...
...
This diff is collapsed.
Click to expand it.
combo/predict.py
+
2
−
2
View file @
bbe33702
...
...
@@ -238,8 +238,8 @@ class COMBO(predictor.Predictor):
@classmethod
def
with_lambo_tokenizer
(
cls
,
model
:
models
.
Model
,
dataset_reader
:
allen_data
.
DatasetReader
):
return
cls
(
model
,
dataset_reader
,
lambo
.
LamboTokenizer
())
dataset_reader
:
allen_data
.
DatasetReader
,
lambo_model_name
:
str
):
return
cls
(
model
,
dataset_reader
,
lambo
.
LamboTokenizer
(
lambo_model_name
))
@classmethod
def
from_pretrained
(
cls
,
path
:
str
,
tokenizer
=
tokenizers
.
SpacyTokenizer
(),
...
...
This diff is collapsed.
Click to expand it.
combo/utils/lambo.py
+
1
−
1
View file @
bbe33702
...
...
@@ -6,7 +6,7 @@ from lambo.segmenter.lambo import Lambo
class
LamboTokenizer
(
Tokenizer
):
def
__init__
(
self
,
model
:
str
=
"
LAMBO_no_pretraining-UD_Polish-PDB
"
,
)
->
None
:
def
__init__
(
self
,
model
:
str
)
->
None
:
self
.
lambo
=
Lambo
.
get
(
model
)
# Simple tokenisation: ignoring sentence split
...
...
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