Skip to content
Snippets Groups Projects
Commit e6eb721f authored by piotrmp's avatar piotrmp
Browse files

Command-line options for LAMBO segmentation.

parent 39a9c9f8
Branches
Tags
No related merge requests found
Pipeline #6331 failed with stage
in 5 minutes and 48 seconds
......@@ -88,8 +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).")
#flags.DEFINE_string(name="lambo_model_name", default="en",
# help="LAMBO model name (if LAMBO used for segmentation).")
def run(_):
"""Run model."""
......@@ -176,7 +176,7 @@ def _get_predictor() -> predictors.Predictor:
)
return predictors.Predictor.from_archive(
archive, FLAGS.predictor_name, "validation", True, {"lambo_model_name" : FLAGS.lambo_model_name}
archive, FLAGS.predictor_name#, extra_args={"lambo_model_name" : FLAGS.lambo_model_name}
)
......
......@@ -238,7 +238,7 @@ class COMBO(predictor.Predictor):
@classmethod
def with_lambo_tokenizer(cls, model: models.Model,
dataset_reader: allen_data.DatasetReader, lambo_model_name : str):
dataset_reader: allen_data.DatasetReader, lambo_model_name : str = 'en'):
return cls(model, dataset_reader, lambo.LamboTokenizer(lambo_model_name))
@classmethod
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment