PickBestFeatureEmbedder#

class langchain_experimental.rl_chain.pick_best_chain.PickBestFeatureEmbedder(auto_embed: bool, model: Any | None = None, *args: Any, **kwargs: Any)[source]#

Embed the BasedOn and ToSelectFrom inputs into a format that can be used by the learning policy.

Parameters:
  • auto_embed (bool) –

  • model (Optional[Any]) –

  • args (Any) –

  • kwargs (Any) –

model name

The type of embeddings to be used for feature representation. Defaults to BERT SentenceTransformer.

Type:

Any, optional

Methods

__init__(auto_embed[,Β model])

format(event)

format_auto_embed_off(event)

Converts the BasedOn and ToSelectFrom into a format that can be used by VW

format_auto_embed_on(event)

get_context_and_action_embeddings(event)

get_indexed_dot_product(context_emb,Β action_embs)

get_label(event)

__init__(auto_embed: bool, model: Any | None = None, *args: Any, **kwargs: Any)[source]#
Parameters:
  • auto_embed (bool) –

  • model (Any | None) –

  • args (Any) –

  • kwargs (Any) –

format(event: PickBestEvent) β†’ str[source]#
Parameters:

event (PickBestEvent) –

Return type:

str

format_auto_embed_off(event: PickBestEvent) β†’ str[source]#

Converts the BasedOn and ToSelectFrom into a format that can be used by VW

Parameters:

event (PickBestEvent) –

Return type:

str

format_auto_embed_on(event: PickBestEvent) β†’ str[source]#
Parameters:

event (PickBestEvent) –

Return type:

str

get_context_and_action_embeddings(event: PickBestEvent) β†’ tuple[source]#
Parameters:

event (PickBestEvent) –

Return type:

tuple

get_indexed_dot_product(context_emb: List, action_embs: List) β†’ Dict[source]#
Parameters:
  • context_emb (List) –

  • action_embs (List) –

Return type:

Dict

get_label(event: PickBestEvent) β†’ tuple[source]#
Parameters:

event (PickBestEvent) –

Return type:

tuple