Git Product home page Git Product logo

intents's Introduction

Intents for Home Assistant

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

Repository layout:

  • 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

See the documentation for more information.

Supported Languages

Code Language Leaders
de German @Scorpoon
dk Danish (position open)
en English (position open)
fr French @benjaminlecouteux
he Hebrew @leranp
hu Hungarian @nagyrobi
nb Norwegian Bokmål (position open)
nl Dutch @TheFes
pl Polish (position open)
sk Slovak (position open)
sv Swedish (position open)

Language leader

Each language is maintained by one or more language leaders. Language leaders are responsible for reviewing the contributions in their language and making sure that they are grammatically correct.

Anyone can apply to become one. If you want to apply to be a language leader, join us in #devs_voice on Discord or open an issue.

Contributing sentences

Anyone can contribute to the repository. The sentences will be reviewed by the language leaders and merged if they are correct. You can either contribute new sentences or improve existing ones.

If you only want to contribute sentences that should be supported, but don't feel comfortable with YAML, you can add them to the issue of your language. Limit your submissions to commands that work with the supported intents.

Intents

See intents.yaml for the Home Assistant intent schemas that are supported.

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. This will create a new virtual environment in the venv directory of the repository, and install all necessary requirements.

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

Test parsing 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"
  }
}

Test sampling sentences

You can sample the possible sentences for a specific language with:

python3 -m script.intentfest sample --language en -n 1

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

python3 -m script.intentfest sample --language en -n 1
{"intent": "HassTurnOff", "text": "turn off all the fan in the kitchen"}
{"intent": "HassTurnOn", "text": "turn on the light in the kitchen"}
{"intent": "HassCloseCover", "text": "close the bedroom lamp"}
{"intent": "HassClimateSetTemperature", "text": "set the temp to 0 degrees celsius"}
{"intent": "HassLightSet", "text": "set the bedroom lamp brightness to 0 percent"}
{"intent": "HassOpenCover", "text": "open the bedroom lamp"}
{"intent": "HassClimateGetTemperature", "text": "what's the temp "}

Leave off -n to generate all possible sentences.

Test sampling template

To quickly test a sentence template, use:

python3 -m script.intentfest sample_template <template>

For example:

python3 -m script.intentfest sample_template 'open [the] door'
open the door
open door

You can add lists, ranges, and expansion rules as well:

python3 -m script.intentfest sample_template 'set color to <color> and brightness to {brightness}' --values color red green --range brightness 1 2 --rule color '[the] {color}'

Add new language

python3 -m script.intentfest add_language <language>

<language> should be something like en or pl according to ISO 639.

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

intents's People

Contributors

aaliankhan avatar balloob avatar bemble avatar berendhaan avatar dependabot[bot] avatar kamildoleglo avatar kblin avatar lellky avatar leranp avatar licmeth avatar ludeeus avatar lukahra avatar martindybal avatar mib1185 avatar nagyrobi avatar piitaya avatar rrakso avatar sanyatuning avatar scorpoon avatar synesthesiam avatar thecode avatar thefes avatar waltlillyman avatar x15pa3ck15x avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.