gnes.encoder.text.torch_transformers module

class gnes.encoder.text.torch_transformers.TorchTransformersEncoder(model_dir: str, model_name: str, tokenizer_name: str, use_cuda: bool = False, *args, **kwargs)[source]

Bases: gnes.encoder.base.BaseTextEncoder

encode(text: List[str], *args, **kwargs) → numpy.ndarray[source]
is_trained = True
post_init()[source]

Declare class attributes/members that can not be serialized in standard way

train(*args, **kwargs)

Train the model, need to be overrided