bemble / intents

Intents to be used with Home Assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intents for Home Assistant

This repository contains training data for Home Assistant's local voice control.

Repository layout:

  • parser
    • Sentence template parser and intent recognizer
  • sentences/<language>
    • YAML files for <language> with the name <domain>_<intent>.yaml
    • File format
  • responses/<language>
    • YAML files for <language> with responses for intents
    • File format
  • tests/<language>
    • YAML files for <language> with test sentences and corresponding intents
    • File format

Supported Languages

  • en - English
  • nl - Dutch

Intents

See intents.yaml for available intent schemas.

Lists

Home Assistant will automatically generate the following lists during recognition:

  • {name}
    • List of device or entity names
  • {area}
    • List of area names

Development

Checkout the repository and get a development enviornment with script/setup.

Before developing, always activate your virtual environment with source venv/bin/activate.

Run tests

Validate the data is correctly formatted.

python3 -m script.intentfest validate

Run the tests. Leave --language off to run all tests.

pytest tests --language nl

Testing sentences

You can try parsing sentences for a specific language with:

python3 -m script.intentfest parse --language en --sentence 'turn on the lights in the kitchen'

This will print a line of JSON for each --sentence:

{
  "text": "turn on the lights in the kitchen",
  "match": true,
  "intent": "HassTurnOn",
  "slots": {
    "area": "kitchen",
    "domain": "light"
  }
}

Add new language

python3 -m script.intentfest add_language <language>

Before you start on a new language, confirm that no one else is already working on one.

About

Intents to be used with Home Assistant

License:Creative Commons Attribution 4.0 International


Languages

Language:Python 95.8%Language:Shell 3.6%Language:ANTLR 0.6%Language:Makefile 0.1%