| Name | hassil JSON |
| Version |
3.4.0
JSON |
| download |
| home_page | None |
| Summary | The Home Assistant Intent Language parser |
| upload_time | 2025-10-28 21:52:15 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.9.0 |
| license | Apache-2.0 |
| keywords |
home
assistant
intent
recognition
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# HassIL
The Home Assistant Intent Language (HassIL) parser for [intents](https://github.com/OHF-Voice/intents).
[Template syntax](docs/template_syntax.md)
## Dependencies
* PyYAML
## Installation
Run the `script/setup` script to automatically create a virtual environment and install the requirements.
# Running
``` sh
python3 -m hassil <yaml_file_or_directory> [<yaml_file_or_directory> ...]
```
Once loaded, you may type in a sentence and see what intent it matches.
For example:
``` sh
python3 -m hassil examples/en.yaml --areas 'living room'
what is the temperature in the living room
{'intent': 'HassClimateGetTemperature', 'area': 'living room', 'domain': 'climate'}
```
Make sure to provide area names with `--areas`. Device or entity names can be provided with `--names`.
``` sh
python3 -m hassil examples/en.yaml --areas office --names trapdoor
open the trapdoor in the office
{'intent': 'HassOpenCover', 'name': 'trapdoor', 'area': 'office'}
```
### Sampling Sentences
Sentences for each intent can be sampled from the intent YAML files:
``` sh
python3 -m hassil.sample examples/en.yaml -n 1
{"intent": "HassTurnOn", "text": "turn on the entity"}
{"intent": "HassTurnOff", "text": "turn off the entity"}
{"intent": "HassOpenCover", "text": "open the entity in the area"}
{"intent": "HassCloseCover", "text": "close the entity in the area"}
{"intent": "HassLightsSet", "text": "set the entity color to red"}
{"intent": "HassClimateSetTemperature", "text": "set temperature to 0 degrees in the area"}
{"intent": "HassClimateGetTemperature", "text": "what is the temperature in the area"}
```
The `--areas` and `--names` arguments are the same from `python3 -m hassil`, but default to generic "area" and "entity" terms.
Exclude the `-n` argument to sample all possible sentences.
## Sentence Templates
Uses a custom parser written in Python.
* Alternative words or phrases
* `(red|green|blue)`
* `turn(s|ed|ing)`
* Optional words or phrases
* `[the]`
* `[this|that]`
* `light[s]`
* Permutations of words or phrases
* `(patience; you must have) my young Padawan`
* `is [the] light (on; in <area>)`
* Slot Lists
* `{list_name}`
* `{list_name:slot_name}`
* Refers to a pre-defined list of values in YAML (`lists`), either global or local (particular to the intent to which the sentence refers)
* Expansion Rules
* `<rule_name>`
* Refers to a pre-defined expansion rule in YAML (`expansion_rules`), either global or local (particular to the intent to which the sentence refers)
## YAML Format
``` yaml
language: "<language code>"
intents:
<intent name>:
data:
# List of sentences/slots/etc.
- sentences:
- "<sentence template>"
- "<sentence template>"
# Optional
slots:
# Fixed slots for the recognized intent
<name>: <value>
requires_context:
# Must be present in match context
<name>: # Any provided value is good
excludes_context:
# Must NOT be present in match context
<name>: <value or list>
expansion_rules:
# Expansion rules which only apply to the intent, referenced as <rule_name>
<rule_name>: <sentence template>
lists:
# Lists which apply only to the current set of sentences, referenced as {list_name} or {list_name:slot_name}
<list name>:
values:
# See below for other possible types
- "items"
- "in list"
metadata:
# Arbitrary key/value pairs that will be available in the result
<key>: <value>
# Optional lists of items that become alternatives in sentence templates
lists:
# Referenced as {list_name} or {list_name:slot_name}
<list name>:
values:
- "items"
- "in list"
- in: "text in"
out: <value for slot>
# Optional
context:
<name>: <value>
metadata:
# Arbitrary key/value pairs that will be available in the result
<key>: <value>
<range_name>
range:
type: "number"
from: 0
to: 100 # inclusive
multiplier: 1.0 # multiply to get final value
<wildcard_name>
wildcard: true
# Optional rules that are expanded in sentence templates
expansion_rules:
# Referenced as <rule_name>
<rule_name>: "<sentence template>"
# Optional words that the intent recognizer can skip during recognition
skip_words:
- "<word>"
```
Raw data
{
"_id": null,
"home_page": null,
"name": "hassil",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9.0",
"maintainer_email": null,
"keywords": "home, assistant, intent, recognition",
"author": null,
"author_email": "The Home Assistant Authors <hello@home-assistant.io>",
"download_url": "https://files.pythonhosted.org/packages/3c/bf/b3036598b80b8ac230782254aa9d039b0939547b466ae8e280cfe0dcdb6a/hassil-3.4.0.tar.gz",
"platform": "any",
"description": "# HassIL\n\nThe Home Assistant Intent Language (HassIL) parser for [intents](https://github.com/OHF-Voice/intents).\n\n[Template syntax](docs/template_syntax.md)\n\n## Dependencies\n\n* PyYAML\n\n\n## Installation\n\nRun the `script/setup` script to automatically create a virtual environment and install the requirements.\n\n\n# Running\n\n``` sh\npython3 -m hassil <yaml_file_or_directory> [<yaml_file_or_directory> ...]\n```\n\nOnce loaded, you may type in a sentence and see what intent it matches.\nFor example:\n\n``` sh\npython3 -m hassil examples/en.yaml --areas 'living room'\nwhat is the temperature in the living room\n{'intent': 'HassClimateGetTemperature', 'area': 'living room', 'domain': 'climate'}\n```\n\nMake sure to provide area names with `--areas`. Device or entity names can be provided with `--names`.\n\n``` sh\npython3 -m hassil examples/en.yaml --areas office --names trapdoor\nopen the trapdoor in the office\n{'intent': 'HassOpenCover', 'name': 'trapdoor', 'area': 'office'}\n```\n\n\n### Sampling Sentences\n\nSentences for each intent can be sampled from the intent YAML files:\n\n``` sh\npython3 -m hassil.sample examples/en.yaml -n 1\n{\"intent\": \"HassTurnOn\", \"text\": \"turn on the entity\"}\n{\"intent\": \"HassTurnOff\", \"text\": \"turn off the entity\"}\n{\"intent\": \"HassOpenCover\", \"text\": \"open the entity in the area\"}\n{\"intent\": \"HassCloseCover\", \"text\": \"close the entity in the area\"}\n{\"intent\": \"HassLightsSet\", \"text\": \"set the entity color to red\"}\n{\"intent\": \"HassClimateSetTemperature\", \"text\": \"set temperature to 0 degrees in the area\"}\n{\"intent\": \"HassClimateGetTemperature\", \"text\": \"what is the temperature in the area\"}\n```\n\nThe `--areas` and `--names` arguments are the same from `python3 -m hassil`, but default to generic \"area\" and \"entity\" terms.\n\nExclude the `-n` argument to sample all possible sentences.\n\n\n## Sentence Templates\n\nUses a custom parser written in Python.\n\n* Alternative words or phrases\n * `(red|green|blue)`\n * `turn(s|ed|ing)`\n* Optional words or phrases\n * `[the]`\n * `[this|that]`\n * `light[s]`\n* Permutations of words or phrases\n * `(patience; you must have) my young Padawan`\n * `is [the] light (on; in <area>)`\n* Slot Lists\n * `{list_name}`\n * `{list_name:slot_name}`\n * Refers to a pre-defined list of values in YAML (`lists`), either global or local (particular to the intent to which the sentence refers)\n* Expansion Rules\n * `<rule_name>`\n * Refers to a pre-defined expansion rule in YAML (`expansion_rules`), either global or local (particular to the intent to which the sentence refers)\n\n\n## YAML Format\n\n``` yaml\nlanguage: \"<language code>\"\nintents:\n <intent name>:\n data:\n # List of sentences/slots/etc.\n - sentences:\n - \"<sentence template>\"\n - \"<sentence template>\"\n # Optional\n slots:\n # Fixed slots for the recognized intent\n <name>: <value>\n requires_context:\n # Must be present in match context\n <name>: # Any provided value is good\n excludes_context:\n # Must NOT be present in match context\n <name>: <value or list>\n expansion_rules:\n # Expansion rules which only apply to the intent, referenced as <rule_name>\n <rule_name>: <sentence template>\n lists:\n # Lists which apply only to the current set of sentences, referenced as {list_name} or {list_name:slot_name}\n <list name>:\n values:\n # See below for other possible types\n - \"items\"\n - \"in list\"\n metadata:\n # Arbitrary key/value pairs that will be available in the result\n <key>: <value>\n\n# Optional lists of items that become alternatives in sentence templates\nlists:\n # Referenced as {list_name} or {list_name:slot_name}\n <list name>:\n values:\n - \"items\"\n - \"in list\"\n - in: \"text in\"\n out: <value for slot>\n # Optional\n context:\n <name>: <value>\n metadata:\n # Arbitrary key/value pairs that will be available in the result\n <key>: <value>\n <range_name>\n range:\n type: \"number\"\n from: 0\n to: 100 # inclusive\n multiplier: 1.0 # multiply to get final value\n <wildcard_name>\n wildcard: true\n\n# Optional rules that are expanded in sentence templates\nexpansion_rules:\n # Referenced as <rule_name>\n <rule_name>: \"<sentence template>\"\n\n# Optional words that the intent recognizer can skip during recognition\nskip_words:\n - \"<word>\"\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "The Home Assistant Intent Language parser",
"version": "3.4.0",
"project_urls": {
"Source Code": "https://github.com/OHF-Voice/hassil"
},
"split_keywords": [
"home",
" assistant",
" intent",
" recognition"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "654d6ab9cf53f62e79c5047da8a7ed909341b72bd59585728aaa6f8ac004abfa",
"md5": "f7fe4bfaae7a7e2370e8b021bb7aaba5",
"sha256": "91347da6aac77ed7c7766bfe81a22a3727a6abff9b347d29d2fdda48b35adc68"
},
"downloads": -1,
"filename": "hassil-3.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f7fe4bfaae7a7e2370e8b021bb7aaba5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.0",
"size": 51100,
"upload_time": "2025-10-28T21:52:13",
"upload_time_iso_8601": "2025-10-28T21:52:13.793654Z",
"url": "https://files.pythonhosted.org/packages/65/4d/6ab9cf53f62e79c5047da8a7ed909341b72bd59585728aaa6f8ac004abfa/hassil-3.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "3cbfb3036598b80b8ac230782254aa9d039b0939547b466ae8e280cfe0dcdb6a",
"md5": "db9b77ce3bad9f74f1dbaf4908f21c77",
"sha256": "23fa8617fe9c3e7e430d9a62fb6a95f44e380fe0896539468f8868db81430510"
},
"downloads": -1,
"filename": "hassil-3.4.0.tar.gz",
"has_sig": false,
"md5_digest": "db9b77ce3bad9f74f1dbaf4908f21c77",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.0",
"size": 59985,
"upload_time": "2025-10-28T21:52:15",
"upload_time_iso_8601": "2025-10-28T21:52:15.211031Z",
"url": "https://files.pythonhosted.org/packages/3c/bf/b3036598b80b8ac230782254aa9d039b0939547b466ae8e280cfe0dcdb6a/hassil-3.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-28 21:52:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "OHF-Voice",
"github_project": "hassil",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "hassil"
}