Skip to main content

Package for Vowpal Wabbit algorithms, featuring high-performance implementations of Contextual Bandits (ADF) and reinforcement learning patterns.

Project description



Sinapsis Vowpal-Wabbit

High-performance Contextual Bandits and Reinforcement Learning using Vowpal Wabbit

🐍 Installation🚀 Features📚 Usage example📙 Documentation🔍 License

Sinapsis Vowpal Wabbit provides a modular framework for implementing real-time decision-making systems. By leveraging the industry-standard Vowpal Wabbit engine, this module enables efficient online learning and reinforcement learning (RL) workflows with minimal latency.

🐍 Installation

Install using your package manager of choice. We encourage the use of uv

Example with uv:

  uv pip install sinapsis-vowpal-wabbit --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-vowpal-wabbit --extra-index-url https://pypi.sinapsis.tech

[!IMPORTANT] Templates may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:

with uv:

  uv pip install sinapsis-vowpal-wabbit[all] --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-vowpal-wabbit[all] --extra-index-url https://pypi.sinapsis.tech

[!TIP] Use CLI command sinapsis info --all-template-names to show a list with all the available Template names installed with Sinapsis OCR.

[!TIP] Use CLI command sinapsis info --example-template-config CBExploreADFPredict to produce an example Agent config for the CBExploreADFPredict template.

🚀 Features

Templates Supported

This repository implements specific templates for Vowpal Wabbit's most powerful reductions:

  • CBExploreADFPredict: Handles real-time inference for Contextual Bandits using Action-Dependent Features (ADF).

  • CBExploreADFLearn: Template to perform offline learning. It iterates through historical datasets (context, action, reward) for a defined number of epochs to optimize the model weights before deployment.

  • CBExploreADFPredictEmbeddings: Handles real-time inference for Contextual Bandits using Action-Dependent Features (ADF) enhanced with text embeddings. This template processes incoming context and actions by combining traditional raw text features with vector-based embeddings to provide more nuanced, semantically aware predictions in production environments.

  • CBExploreADFLearnEmbeddings: Template for offline learning that incorporates text embeddings into the optimization process. It iterates through historical datasets (context, actions, and rewards) over a defined number of epochs. By training on a combination of raw text and sentence based embeddings, it captures deeper semantic relationships to more effectively optimize model weights prior to deployment.

📚 Usage example

CBExploreADFPredict Example
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: CBExploreADFPredict
  class_name: CBExploreADFPredict
  template_input: InputTemplate
  attributes:
    stop_words: ["from", "at", "i", "you"]
    clean_text_pattern: '[^a-z0-9\s]'
    actions: ["action_1", "action_2","action_3"]
    vw_workspace_params:
      bit_precision: 24
      quadratic_interactions: ["CA"]
      cubic_interactions: []
      ngram_namespaces: ["C"]
      ngram_size: 2
      learning_rate: 0.5
      l1: 0.0
      l2: 0.0
      exploration_method: epsilon
      exploration_value: 0.2
      adaptive: true
      normalized: true
      quiet: false
    remove_stop_words: false
    remove_special_characters: true
    model_path: "artifacts/model.vw"
    inference_only: true
    threshold: 0
    top_k: 3

To run, simply use:

sinapsis run name_of_the_config.yml

📙 Documentation

Documentation for this and other sinapsis packages is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.

For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinapsis_vowpal_wabbit-0.1.1.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinapsis_vowpal_wabbit-0.1.1-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file sinapsis_vowpal_wabbit-0.1.1.tar.gz.

File metadata

File hashes

Hashes for sinapsis_vowpal_wabbit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cb52cb2107d603236ed792eb68a3716686d2e87a13b0970c09499e4cd36012c8
MD5 1dfa7cd462c7cb53a8da8d0ac23fedca
BLAKE2b-256 9a5174c7ab7d9504fde6c7e0d3e042a5f6c78d09aa05c2c096d22fc989b2af12

See more details on using hashes here.

File details

Details for the file sinapsis_vowpal_wabbit-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sinapsis_vowpal_wabbit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eedcbb902b1168bf08e2531dee068848142ac1e09c8d474f5b317b150ac28934
MD5 df04fc65e1a3e3ed80daebb8290628f4
BLAKE2b-256 911eb37706150e7e8669865d551052933afa823df597778a8d2e657bfbf81be7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page