kazu.training.train_multilabel_ner¶
Functions
|
|
Classes
SavedModel(path: pathlib.Path, step: int, metrics: dict[str, typing.Any] = <factory>) |
|
- class kazu.training.train_multilabel_ner.KazuMultiHotNerMultiLabelTrainingDataset[source]¶
- class kazu.training.train_multilabel_ner.ModelSaver[source]¶
Bases:
object
- save(model, step, tokenizer, metrics, stopping_metric, test_docs=None)[source]¶
- Parameters:
model (PreTrainedModel)
step (int)
tokenizer (PreTrainedTokenizerFast)
stopping_metric (str)
- Return type:
None
- static save_model(tokenizer, model, path)[source]¶
- Parameters:
tokenizer (PreTrainedTokenizerFast)
model (PreTrainedModel)
path (Path)
- Return type:
None
- class kazu.training.train_multilabel_ner.SavedModel[source]¶
Bases:
object
SavedModel(path: pathlib.Path, step: int, metrics: dict[str, typing.Any] = <factory>)
- class kazu.training.train_multilabel_ner.Trainer[source]¶
Bases:
object
- __init__(training_config, pretrained_model_name_or_path, label_list, train_dataset, test_dataset, working_dir, summary_writer=None, ls_wrapper=None)[source]¶
- Parameters:
training_config (TrainingConfig)
pretrained_model_name_or_path (str)
train_dataset (KazuMultiHotNerMultiLabelTrainingDataset)
test_dataset (KazuMultiHotNerMultiLabelTrainingDataset)
working_dir (Path)
summary_writer (SummaryWriter | None)
ls_wrapper (LSManagerViewWrapper | None)
- evaluate_model(model, global_step, save_model=True)[source]¶
- Parameters:
model (PreTrainedModel)
global_step (int)
save_model (bool)
- Return type:
None