Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

License

Adapt Intent Parser

The Adapt Intent Parser is a flexible and extensible intent definition and determination framework. It is intended to parse natural language text into a structured intent that can then be invoked programatically.

This repository contains a OVOS pipeline plugin and bundles a fork of the original adapt-parser from the defunct MycroftAI.

Pipeline Plugins

Three OPM pipeline entry points are exposed:

  • ovos-adapt-pipeline-plugin (AdaptPipeline) — the flat pipeline, wrapping a single IntentDeterminationEngine. All skills share one trie.
  • ovos-adapt-domain-pipeline-plugin (DomainAdaptPipeline) — a per-skill pipeline wrapping DomainIntentDeterminationEngine. Each skill_id gets its own sub-engine ("domain"); at match time every domain is scored in parallel and a global argmax wins. Configurable under intents.ovos_adapt_domain_pipeline.
  • ovos-adapt-hierarchical-pipeline-plugin (HierarchicalAdaptPipeline) — the per-skill domain model with two-stage routing: a stage-1 classifier picks one domain, then only that domain's sub-engine is scored. Configurable under intents.ovos_adapt_hierarchical_pipeline.

See Pipeline variants for when to use each.

Documentation

A zero-to-hero guide lives in docs/:

Examples

Executable examples can be found in the examples folder.

Intent Modelling

In this context, an Intent is an action the system should perform. In the context of Pandora, we’ll define two actions: List Stations, and Select Station (aka start playback)

With the Adapt intent builder:

list_stations_intent = IntentBuilder('pandora:list_stations')\
    .require('Browse Music Command')\
    .build()

For the above, we are describing a “List Stations” intent, which has a single requirement of a “Browse Music Command” entity.

play_music_command = IntentBuilder('pandora:select_station')\
    .require('Listen Command')\
    .require('Pandora Station')\
    .optionally('Music Keyword')\
    .build()

For the above, we are describing a “Select Station” (aka start playback) intent, which requires a “Listen Command” entity, a “Pandora Station”, and optionally a “Music Keyword” entity.

Entities

Entities are a named value. Examples include: Blink 182 is an Artist The Big Bang Theory is a Television Show Play is a Listen Command Song(s) is a Music Keyword

For my Pandora implementation, there is a static set of vocabulary for the Browse Music Command, Listen Command, and Music Keyword (defined by me, a native english speaker and all-around good guy). Pandora Station entities are populated via a "List Stations" API call to Pandora. Here’s what the vocabulary registration looks like.

def register_vocab(entity_type, entity_value):
    pass
    # a tiny bit of code 

def register_pandora_vocab(emitter):
    for v in ["stations"]:
        register_vocab('Browse Music Command', v)

    for v in ["play", "listen", "hear"]:
        register_vocab('Listen Command', v)

    for v in ["music", "radio"]:
        register_vocab('Music Keyword', v)

    for v in ["Pandora"]:
        register_vocab('Plugin Name', v)

    station_name_regex = re.compile(r"(.*) Radio")
    p = get_pandora()
    for station in p.stations:
        m = station_name_regex.match(station.get('stationName'))
        if not m:
            continue
        for match in m.groups():
            register_vocab('Pandora Station', match)

Reporting Issues

It's often difficult to debug issues with adapt without a complete context. To facilitate simpler debugging, please include a serialized copy of the intent determination engine using the debug dump utilities.

from ovos_adapt.engine import IntentDeterminationEngine

engine = IntentDeterminationEngine()
# Load engine with vocabulary and parsers

import ovos_adapt.tools.debug as atd

atd.dump(engine, 'debug.ovos_adapt')

Download files

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

Source Distribution

ovos_adapt_parser-1.6.3a1.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

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

ovos_adapt_parser-1.6.3a1-py3-none-any.whl (48.5 kB view details)

Uploaded Python 3

File details

Details for the file ovos_adapt_parser-1.6.3a1.tar.gz.

File metadata

  • Download URL: ovos_adapt_parser-1.6.3a1.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ovos_adapt_parser-1.6.3a1.tar.gz
Algorithm Hash digest
SHA256 4805eeea4cffff46434ceac8ded4680d39371bf5ed478b73664f685c999af3a0
MD5 3d739a1aef0cc24dfd9288872a9c78ab
BLAKE2b-256 0f79f0c75ff88368d7e8da8b8208d21147001268974badd40f45c31d58755f0a

See more details on using hashes here.

File details

Details for the file ovos_adapt_parser-1.6.3a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_adapt_parser-1.6.3a1-py3-none-any.whl
Algorithm Hash digest
SHA256 f05d1ffec34eb018dfe14e0d65ff122de50fbbf93fbeb3b11de0676749baf949
MD5 b223e143cfc5dbd5a86f5a4a6301ad57
BLAKE2b-256 c6f9bb61c647a6f0143bfd833b2373034f924f9a281b6a491b6f0e7fbba02552

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.6.3a1 This release

2 files

1.0.9

2 files

1.0.8

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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