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_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