Skip to content

Commit

Permalink
[En] remove the from <light> (#2728)
Browse files Browse the repository at this point in the history
* [en] Remove `the` from `<light>` and move to sentences

This doesn't always make sense in a sentence to allow `the` to prefix. It's not
that big of a deal, however once adding `<the>` in, it does increase the number
of matching sentences by even more. This patch can be considered an optimization
rather than a quality improvement.
  • Loading branch information
ViViDboarder authored Jan 8, 2025
1 parent 5652f6a commit f1976de
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 55 deletions.
2 changes: 1 addition & 1 deletion sentences/en/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ expansion_rules:
are_any: "[<are>] <any>"
how_many: "how many [of <the>]"
brightness: "{brightness}[([ ]%)| percent]"
light: "[<the>] (light|lights|lighting|lamp|lamps)"
light: "(light|lights|lighting|lamp|lamps)"
turn: "(turn|switch|change|bring)"
temp: "(temp|temperature)"
temperature: "{temperature}[([ ]°[[ ]{temperature_unit}])|( degrees {temperature_unit})]"
Expand Down
8 changes: 4 additions & 4 deletions sentences/en/light_HassLightSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ intents:
- "[<numeric_value_set>] <area> brightness [to] <brightness>"
- "[<numeric_value_set>] <area> [to] <brightness> brightness"
- "[<numeric_value_set>] <area> [to] <brightness>"
- "[<numeric_value_set>] [all] [the] lights [<in>] <area> to <brightness> [brightness]"
- "[<numeric_value_set>] [(<all>|<the>)] <light> [<in>] <area> to <brightness> [brightness]"
response: "brightness"

- sentences:
Expand Down Expand Up @@ -78,13 +78,13 @@ intents:
domain: light
response: "color"
- sentences:
- "[<set>] [[the] color of] (<area> | [all [the]] lights in <area> | [all] <area> lights) [to] {color}"
- "[<set>] [[the] color of] (<area> | [<all>] lights in <area> | [all] <area> lights) [to] {color}"
- "[<set>] (<area> | [all] lights in <area> | [all] <area> lights) [color] [to] {color}"
response: "color"

- sentences:
- "[<set>] [[the] color of] [all] <light> [to] {color}"
- "[<set>] [[the] color of] [all] <light> (<in_here>;[to] {color})"
- "[<set>] [[the] color of] [(<all>|<the>)] <light> [to] {color}"
- "[<set>] [[the] color of] [(<all>|<the>)] <light> (<in_here>;[to] {color})"
expansion_rules:
in_here: "[in] here"
response: "color"
Expand Down
48 changes: 21 additions & 27 deletions sentences/en/light_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,14 @@ intents:
# Turn off all lights in an area
- sentences:
- "<area> <light> (off|out)"
- "<light> (off|out) [in] <area>"
- "<light> (off|out) [<in>] <area>"
- "<turn> (off|out) [<all>] <area> <light>"
- "<turn> (off|out) [<all>] <light> <in> <area>"
- "<turn> (off|out) [(<all>|<the>)] <light> <in> <area>"
- "[<turn>] [<all>] <area> <light> (off|out)"
- "[<turn>] [<all>] <light> <in> <area> (off|out)"
- "[<turn>] [<all>] <light> (off|out) <in> <area>"
- "[<turn>] [(<all>|<the>)] <light> <in> <area> (off|out)"
- "[<turn>] [(<all>|<the>)] <light> (off|out) <in> <area>"
- "deactivate [<all>] <area> <light>"
- "deactivate [<all>] <light> <in> <area>"
- "<turn> (off|out) [all] <light> in <area>"
- "<turn> (off|out) [all] <area> <light>"
- "[<turn>] [all] <area> <light> (off|out)"
- "[<turn>] [all] <light> [in] <area> (off|out)"
- "<light> (off|out) in <area>"
- "<area> <light> (off|out)"
- "deactivate [(<all>|<the>)] <light> <in> <area>"
slots:
domain: "light"
response: "lights_area"
Expand All @@ -39,25 +33,25 @@ intents:
- "<floor> <light> (off|out)"
- "<light> (off|out) [<in>] <floor>"
- "<turn> (off|out) [<all>] <floor> <light>"
- "<turn> (off|out) [<all>] <light> [<in>] <floor>"
- "<turn> (off|out) [(<all>|<the>)] <light> [<in>] <floor>"
- "[<turn>] [<all>] <floor> <light> (off|out)"
- "[<turn>] [<all>] <light> [<in>] <floor> (off|out)"
- "[<turn>] [<all>] <light> (off|out) [<in>] <floor>"
- "[<turn>] [(<all>|<the>)] <light> [<in>] <floor> (off|out)"
- "[<turn>] [(<all>|<the>)] <light> (off|out) [<in>] <floor>"
- "deactivate [<all>] <floor> <light>"
- "deactivate [<all>] <light> [<in>] <floor>"
- "deactivate [(<all>|<the>)] <light> [<in>] <floor>"
response: "lights_floor"
slots:
domain: "light"

# Turn off all lights in the home
- sentences:
- "<turn> <all> <light> (off|out) [<everywhere>]"
- "<turn> <light> (off|out) <everywhere>"
- "<turn> [<the>] <light> (off|out) <everywhere>"
- "<turn> (off|out) <all> <light> [<everywhere>]"
- "<turn> (off|out) <light> <everywhere>"
- "<turn> (off|out) [<the>] <light> <everywhere>"
- "<turn> (off|out) [<all>] [the] <home> <light> <everywhere>"
- "deactivate <all> <light> [<everywhere>]"
- "deactivate <light> <everywhere>"
- "deactivate [<the>] <light> <everywhere>"
- "get every <light> (off|out) [<everywhere>]"
- "make sure <all> <light> <is> (off|out)"
response: "light_all"
Expand All @@ -67,17 +61,17 @@ intents:
# Turn off lights in the same area as a satellite device
- sentences:
# Explicit <here> optional all
- "<turn> [<all>] <light> (off|out) <here>"
- "<turn> [<all>] <light> <here> (off|out)"
- "<turn> (off|out) [<all>] <light> <here>"
- "deactivate [<all>] <light> <here>"
- "[<all>] <light> (off|out) <here>"
- "<turn> [(<all>|<the>)] <light> (off|out) <here>"
- "<turn> [(<all>|<the>)] <light> <here> (off|out)"
- "<turn> (off|out) [(<all>|<the>)] <light> <here>"
- "deactivate [(<all>|<the>)] <light> <here>"
- "[<all>] [<the>] <light> (off|out) <here>"

# Implicit <here> no all
- "<turn> <light> (off|out) [<here>]"
- "<turn> <light> [<here>] (off|out)"
- "<turn> (off|out) <light> [<here>]"
- "deactivate <light> [<here>]"
- "<turn> [<the>] <light> (off|out) [<here>]"
- "<turn> [<the>] <light> [<here>] (off|out)"
- "<turn> (off|out) [<the>] <light> [<here>]"
- "deactivate [<the>] <light> [<here>]"
- "<light> (off|out) [<here>]"
response: "lights_area"
slots:
Expand Down
45 changes: 22 additions & 23 deletions sentences/en/light_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ intents:
- "<area> <light> on"
- "<light> on [in] <area>"
- "<turn> on [<all>] <area> <light>"
- "<turn> on [<all>] <light> <in> <area>"
- "<turn> on [(<all>|<the>)] <light> <in> <area>"
- "[<turn>] [<all>] <area> <light> on"
- "[<turn>] [<all>] <light> <in> <area> on"
- "[<turn>] [<all>] <light> on <in> <area>"
- "[<turn>] [(<all>|<the>)] <light> <in> <area> on"
- "[<turn>] [(<all>|<the>)] <light> on <in> <area>"
- "activate [<all>] <area> <light>"
- "activate [<all>] <light> <in> <area>"
- "activate [(<all>|<the>)] <light> <in> <area>"
slots:
domain: "light"
response: "lights_area"
Expand All @@ -38,29 +38,28 @@ intents:
- "<floor> <light> on"
- "<light> on [<in>] <floor>"
- "<turn> on [<all>] <floor> <light>"
- "<turn> on [<all>] <light> [<in>] <floor>"
- "<turn> on [(<all>|<the>)] <light> [<in>] <floor>"
- "[<turn>] [<all>] <floor> <light> on"
- "[<turn>] [<all>] <light> [<in>] <floor> on"
- "[<turn>] [<all>] <light> on [<in>] <floor>"
- "[<turn>] [(<all>|<the>)] <light> [<in>] <floor> on"
- "[<turn>] [(<all>|<the>)] <light> on [<in>] <floor>"
- "activate [<all>] <floor> <light>"
- "activate [<all>] <light> [<in>] <floor>"
- "activate [(<all>|<the>)] <light> [<in>] <floor>"
response: "lights_floor"
slots:
domain: "light"

# Turn on all lights in the home
- sentences:
- "(light up|activate|illuminate) <all> <light> <everywhere>"
- "(light up|illuminate) the (entire|whole) <home>"
- "(light up|illuminate) <everywhere> [<everywhere>]"
- "<turn> <all> <light> on [<everywhere>]"
- "<turn> <light> on <everywhere>"
- "<turn> [<the>] <light> on <everywhere>"
- "<turn> on <all> <light> [<everywhere>]"
- "<turn> on <light> <everywhere>"
- "<turn> on [<all>] [the] <home> <light> <everywhere>"
- "<turn> on [<the>] <light> <everywhere>"
- "<turn> on [(<all>|<the>)] <home> <light> <everywhere>"
- "activate <all> <light> [<everywhere>]"
- "activate <light> <everywhere>"
- "get every <light> on [<everywhere>]"
- "activate [<the>] <light> <everywhere>"
- "get <all> <light> on [<everywhere>]"
- "illuminate <all> areas [<everywhere>]"
- make sure <all> <light> <is> on
response: "light_all"
Expand All @@ -70,17 +69,17 @@ intents:
# Turn on lights in the same area as a satellite device
- sentences:
# Explicit <here> optional all
- "<turn> [<all>] <light> on <here>"
- "<turn> [<all>] <light> <here> on"
- "<turn> on [<all>] <light> <here>"
- "activate [<all>] <light> <here>"
- "[<all>] <light> on <here>"
- "<turn> [(<all>|<the>)] <light> on <here>"
- "<turn> [(<all>|<the>)] <light> <here> on"
- "<turn> on [(<all>|<the>)] <light> <here>"
- "activate [(<all>|<the>)] <light> <here>"
- "[(<all>|<the>)] <light> on <here>"

# Implicit <here> no all
- "<turn> <light> on [<here>]"
- "<turn> <light> [<here>] on"
- "<turn> on <light> [<here>]"
- "activate <light> [<here>]"
- "<turn> [<the>] <light> on [<here>]"
- "<turn> [<the>] <light> [<here>] on"
- "<turn> on [<the>] <light> [<here>]"
- "activate [<the>] <light> [<here>]"
- "<light> on [<here>]"
- "light (it|<here>) up"
- "light up [<here>]"
Expand Down
16 changes: 16 additions & 0 deletions tests/en/light_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ tests:
- turn the lighting in the kitchen off
- turn the lights in kitchen off
- turn the lights in the kitchen off
- turn off my kitchen lights
- turn off our kitchen lights
- turn off all my kitchen lights
- turn off all our kitchen lights
intent:
name: HassTurnOff
slots:
Expand Down Expand Up @@ -73,6 +77,10 @@ tests:
- turn off the house lights everywhere
- turn the lights off in all the rooms
- turn the lights off in the house
- turn off all my lights
- turn off all our lights
- turn off all the lights in my home
- turn off all the lights in our home
intent:
name: HassTurnOff
slots:
Expand Down Expand Up @@ -104,6 +112,10 @@ tests:
- turn the lights in here off
- turn the lights off
- turn the lights off here
- turn off my lights here
- turn off our lights here
- turn off all the lights in my room
- turn off all the lights in our room
intent:
name: HassTurnOff
context:
Expand Down Expand Up @@ -150,6 +162,10 @@ tests:
- turn the light in the first floor off
- turn the lighting in the first floor off
- turn the lights in first floor off
- turn off my first floor lights
- turn off our first floor lights
- turn off all my first floor lights
- turn off all our first floor lights
intent:
name: HassTurnOff
slots:
Expand Down
Loading

0 comments on commit f1976de

Please sign in to comment.