CBExploreADFLearnEmbeddings
Python template · sinapsis_vowpal_wabbit.templates.cb_explore_adf_learn_embeddings
Overview
Template to perform action learning using the Vowpal Wabbit CB_Explore_ADF approach.
Uses text instructions and action labels, enhanced with sentence embeddings.
Attributes: actions (list[str]): List of available actions for the contextual bandit. vw_workspace_params (CBExploreADFWorkspaceParams): Workspace parameters specific to the CB explore-adf algorithm. Defaults to an empty CBExploreADFWorkspaceParams instance if not provided or if an empty dict is passed. remove_stop_words (bool): Flag indicating whether to remove stop words from text. Defaults to False. remove_special_characters (bool): Flag indicating whether to remove special characters from text. Defaults to True. epochs (int): Number of training epochs. Defaults to 5. instruction_column (str): Name of the column containing instructions or features. true_action_column (str): Name of the column containing the true/correct actions. split_dataset (bool): Whether to split the dataset into train and test sets. Defaults to True. train_test_split_params (TrainTestSplitParams): Parameters for train-test split configuration. Defaults to an empty dictionary via factory. root_dir (str): Root directory path for model storage. save_path (str): Relative path within root_dir where the model will be saved. full_save_path (str): Computed property that combines root_dir and save_path into a single absolute file system path. sentence_transformer_params (SentenceTransformerParams): Configuration parameters for the SentenceTransformer model used to generate embeddings from text. Defaults to an empty SentenceTransformerParams instance if not provided or if an empty dict is passed.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
pip install sinapsis-vowpal-wabbit==1.0.0uv pip install sinapsis-vowpal-wabbit==1.0.0uv add sinapsis-vowpal-wabbit==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
Number of training epochs. Defaults to 5.
Optional
Default: 5
Required
Default: null
Optional
Default: null
Root directory path for model storage.
Optional
Default: "/home/ariel/.cache/sinapsis"
Relative path within root_dir where the model will be saved. full_save_path (str): Computed property that combines root_dir and save_path into a single absolute file system path.
Optional
Default: "cb_explore_adf_model.vw"
Optional
Default: ["i","me","my","myself","we","our","ours","ourselves","you","you're","your","yours","yourself","yourselves","he","him","his","himself","she","her","hers","herself","it","its","itself","they","them","their","theirs","themselves","what","which","who","whom","this","that","these","those","am","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","a","an","the","and","but","if","or","because","as","until","while","of","at","by","for","with","about","against","between","into","through","during","before","after","above","below","to","from","up","down","in","out","on","off","over","under","again","further","then","once","here","there","when","where","why","how"]
Optional
Default: null
Whether to split the dataset into train and test sets. Defaults to True.
Optional
Default: true
Optional
Default: false
Optional
Default: "[^a-z0-9\\s]"
Name of the column containing instructions or features.
Required
Default: null
Name of the column containing the true/correct actions.
Required
Default: null
Optional
Default: null
Optional
Default: 0
Optional
Default: 0
Whether to suppress output. Defaults to False. Raises: ValueError: If exploration_value is inconsistent with exploration_method: - If method is "first" or "bag" but value is not an integer - If method is "epsilon" but… Read full field description
Whether to suppress output. Defaults to False. Raises: ValueError: If exploration_value is inconsistent with exploration_method: - If method is "first" or "bag" but value is not an integer - If method is "epsilon" but value is not a float or outside [0.0, 1.0] Properties: vw_exploration_string: Generates the corresponding Vowpal Wabbit command line arguments for the configured exploration method and value.
Optional
Default: false
Whether to use adaptive exploration. Defaults to True.
Optional
Default: true
Optional
Default: 2
Whether to use normalized weights. Defaults to True.
Optional
Default: true
Optional
Default: 24
Optional
Default: null
Optional
Default: []
The value parameter for the chosen exploration method. - For "first" and "bag": Must be an integer (e.g., number of actions to explore) - For "epsilon": Must be a float between 0.0 and 1.0 (exploration probability) - For "softmax": Must be a float (lambda/temperature parameter) Defaults to 0.2.
Optional
Default: 0.2
Optional
Default: []
The exploration strategy to use. Options are: - "first": Explores the first action - "epsilon": Epsilon-greedy exploration - "bag": Bagging/bootstrap exploration - "softmax": Softmax exploration with temperature parameter Defaults to "epsilon".
Optional
Default: "epsilon"
Optional
Default: []
Parameters for train-test split configuration. Defaults to an empty dictionary via factory.
Optional
Default: null
Optional
Default: true
Optional
Default: null
Optional
Default: null
Optional
Default: true
Configuration parameters for the SentenceTransformer model used to generate embeddings from text. Defaults to an empty SentenceTransformerParams instance if not provided or if an empty dict is passed.
Optional
Default: null
Optional
Default: "cuda:0"
Optional
Default: "float32"
Optional
Default: 32
Optional
Default: "all-MiniLM-L6-v2"
Optional
Default: true
Configuration example
Generated from documented defaults. Replace any placeholders and complete required nested settings before running.
templates:
- template_name: "CBExploreADFLearnEmbeddings"
class_name: "CBExploreADFLearnEmbeddings"
attributes:
epochs: 5
actions: "<required>"
root_dir: "/home/ariel/.cache/sinapsis"
save_path: "cb_explore_adf_model.vw"
stop_words: {}
random_seed: null
split_dataset: true
remove_stop_words: false
clean_text_pattern: "[^a-z0-9\\s]"
instruction_column: "<required>"
true_action_column: "<required>"
vw_workspace_params:
l1: 0
l2: 0
quiet: false
adaptive: true
ngram_size: 2
normalized: true
bit_precision: 24
learning_rate: null
ngram_namespaces: []
exploration_value: 0.2
cubic_interactions: []
exploration_method: "epsilon"
quadratic_interactions: []
train_test_split_params:
shuffle: true
test_size: null
train_size: null
remove_special_characters: true
sentence_transformer_params:
device: "cuda:0"
precision: "float32"
batch_size: 32
model_name: "all-MiniLM-L6-v2"
normalize_embeddings: true
Inheritance
sinapsis_vowpal_wabbit.templates.cb_explore_adf_learn.CBExploreADFLearnEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.