sgnlp.models.ufd.utils.extract_embeddings¶
-
extract_embeddings
(cfg: sgnlp.models.ufd.data_class.UFDArguments, dataset: List, tokenizer: sgnlp.models.ufd.tokenization.UFDTokenizer, model: sgnlp.models.ufd.modeling.UFDEmbeddingModel) → List[source]¶ Helper function to extract embeddings with the UFD embedding model.
- Parameters
cfg (UFDArguments) – UFDArguments config load from configuration file
dataset (List) – list of dataset by line
tokenizer (UFDTokenizer) – UFD tokenizer class instance
model (UFDEmbeddingModel) – UFD embedding model class instance
- Returns
return list of generated embeddings.
- Return type
List