Shortcuts

TextEmbedder

class flash.text.embedding.model.TextEmbedder(backbone='sentence-transformers/all-MiniLM-L6-v2', max_length=128, tokenizer_backbone=None, tokenizer_kwargs=None, enable_ort=False)[source]

The TextEmbedder is a Task for generating sentence embeddings, training and validation. For more details, see embeddings.

You can change the backbone to any question answering model from UKPLab/sentence-transformers using the backbone argument.

Parameters
classmethod available_finetuning_strategies(cls)

Returns a list containing the keys of the available Finetuning Strategies.

Return type

List[str]

classmethod available_lr_schedulers(cls)

Returns a list containing the keys of the available LR schedulers.

Return type

List[str]

classmethod available_optimizers(cls)

Returns a list containing the keys of the available Optimizers.

Return type

List[str]

classmethod available_outputs(cls)

Returns the list of available outputs (that can be used during prediction or serving) for this Task.

Examples

..testsetup:

>>> from flash import Task
>>> print(Task.available_outputs())
['preds', 'raw']
Return type

List[str]

forward(batch)[source]

Adapted from sentence-transformers:

https://github.com/UKPLab/sentence-transformers/blob/master/sentence_transformers/models/Transformer.py#L45

Return type

Tensor

Read the Docs v: 0.7.3
Versions
latest
stable
0.7.3
0.7.2
0.7.1
0.7.0
0.6.0
0.5.2
0.5.1
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0post1
docs-fix_typing
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.