-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ja] new language (add japanese) #2292
base: main
Are you sure you want to change the base?
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe changes introduce a new language entry for Japanese (日本語) in the Changes
Sequence Diagram(s)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
language: ja | ||
intents: | ||
HassTurnOff: | ||
data: | ||
- sentences: | ||
- "[<area>の]<name>[を|お](けして|消して|きって|切って|オフ[に][して])" | ||
excludes_context: | ||
domain: | ||
- binary_sensor | ||
- cover | ||
- lock | ||
- scene | ||
- sensor | ||
- valve | ||
# another intent | ||
- light | ||
- script | ||
- fan | ||
slots: | ||
domain: switch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding comments for clarity.
Adding comments to explain the purpose of each section (e.g., excludes_context
, slots
) can improve maintainability and readability.
language: ja | ||
areas: | ||
- name: "リビング" | ||
id: "living" | ||
|
||
- name: "寝室" | ||
id: "bedroom" | ||
|
||
entities: | ||
- name: "ライト1" | ||
id: light.light1 | ||
area: "living" | ||
state: "on" | ||
|
||
- name: "ライト2" | ||
id: light.light2 | ||
area: "living" | ||
state: "on" | ||
|
||
- name: "ライト3" | ||
id: light.light3 | ||
area: "bedroom" | ||
state: "on" | ||
|
||
- name: "スイッチ1" | ||
id: switch.switch1 | ||
area: "living" | ||
|
||
- name: "スイッチ2" | ||
id: switch.switch2 | ||
area: "bedroom" | ||
|
||
- name: "スクリプトSW1" | ||
id: script.script_sw1 | ||
area: "living" | ||
|
||
- name: "ファン1" | ||
id: fan.fan1 | ||
area: "living" | ||
|
||
- name: "LED" | ||
id: light.led | ||
area: "bedroom" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding comments for clarity.
Adding comments to explain the purpose of each section (e.g., areas
, entities
) can improve maintainability and readability.
language: ja | ||
intents: | ||
HassTurnOn: | ||
data: | ||
- sentences: | ||
- "[<area>の]<name>[の<light>][を|お](つけて|付けて|いれて|入れて|オン[に][して])" | ||
excludes_context: | ||
domain: | ||
- switch | ||
- fan | ||
requires_context: | ||
domain: | ||
- light | ||
slots: | ||
domain: light | ||
|
||
# Turn on all lights in a area | ||
- sentences: | ||
- "<area>の[<all>の]<light>[を|お](つけて|付けて|いれて|入れて|オン[に][して])" | ||
excludes_context: | ||
domain: | ||
- switch | ||
- fan | ||
slots: | ||
domain: "light" | ||
response: "lights_area" | ||
|
||
# Turn on all lights in the home | ||
- sentences: | ||
- "<all><light>[を|お](つけて|付けて|いれて|入れて|オン[に][して])" | ||
slots: | ||
domain: "light" | ||
response: "light_all" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding comments for clarity.
Adding comments to explain the purpose of each section (e.g., excludes_context
, slots
, response
) can improve maintainability and readability.
language: ja | ||
intents: | ||
HassTurnOff: | ||
data: | ||
- sentences: | ||
- "[<area>の]<name>[の<light>][を|お](けして|消して|きって|切って|オフ[に][して])" | ||
excludes_context: | ||
domain: | ||
- switch | ||
- fan | ||
requires_context: | ||
domain: | ||
- light | ||
slots: | ||
domain: light | ||
|
||
# Turn off all lights in a area | ||
- sentences: | ||
- "<area>の[<all>の]<light>[を|お](けして|消して|きって|切って|オフ[に][して])" | ||
excludes_context: | ||
domain: | ||
- switch | ||
- fan | ||
slots: | ||
domain: light | ||
response: "lights_area" | ||
|
||
# Turn off all lights in the home | ||
- sentences: | ||
- "<all><light>[を|お](けして|消して|きって|切って|オフ[に][して])" | ||
slots: | ||
domain: "light" | ||
response: "light_all" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding comments for clarity.
Adding comments to explain the purpose of each section (e.g., excludes_context
, slots
, response
) can improve maintainability and readability.
language: ja | ||
tests: | ||
- sentences: | ||
- "リビングのスイッチ1オフ" | ||
intent: | ||
name: HassTurnOff | ||
slots: | ||
domain: switch | ||
name: "スイッチ1" | ||
area: "リビング" | ||
|
||
- sentences: | ||
- "スイッチ2オフして" | ||
intent: | ||
name: HassTurnOff | ||
slots: | ||
domain: switch | ||
name: "スイッチ2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Ensure completeness of test cases for switches
The test cases for turning off switches in tests/ja/homeassistant_HassTurnOff.yaml
are limited to two variations. Consider adding more variations and edge cases similar to the comprehensive test cases for lights in tests/ja/light_HassTurnOff.yaml
.
- Add more variations for turning off switches, including different ways to phrase the command.
- Include edge cases such as turning off all switches in an area.
Analysis chain
Ensure the completeness of test cases.
The test cases cover a good range of variations for turning off switches in Japanese. Ensure that all possible variations and edge cases are covered.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the completeness of test cases for turning off switches in Japanese.
# Test: Check for all possible variations of turning off switches commands.
rg --type yaml 'スイッチ' tests/ja/homeassistant_HassTurnOff.yaml
Length of output: 195
Script:
#!/bin/bash
# Description: Verify the completeness of test cases for turning off switches in Japanese.
# Test: Check for all instances of the "HassTurnOff" intent in the entire tests/ja directory.
rg --type yaml 'HassTurnOff' tests/ja
Length of output: 389
Script:
#!/bin/bash
# Description: Display the content of tests/ja/light_HassTurnOff.yaml to analyze additional test cases for the "HassTurnOff" intent.
cat tests/ja/light_HassTurnOff.yaml
Length of output: 894
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you! Welcome!
Can you reach out to Missy on Discord to be added to the language leaders channel
Thank you for providing such a great system.
I have created a part of Japanese "intents".
The test results are also attached for your consideration for registration.
===== For those who use Japanese =====(日本語環境を使われる方へ)
In this case, only the basic operation of lights and switches is created and checked.
Please refer to it and brush up.
今回はライトやスイッチの基本動作だけ作成・確認しています。
参考にしていただき、ブラッシュアップをよろしくお願いします。
<<faster-whisperの認識について>>
・tiny-int8(Beamsize:未定)では
発声の問題もありますが、以下のような変換となり、うまく機能しないことが多発
「ライト2を切って」===>「ライトにお置きて」
対策1:エリアスに「ライト2」だけでなく「ライトに」を追加
「1」も「いち」になることがあるため数字には注意
対策2:「ライト2 オフ」などエンティティと指示だけの発声にする
・base-int8(Beamsize:10)では(私の環境)
「ライト2を切って」===>「ライトにをきって」
※かなり認識が改善され、ほぼ問題なく機能しますが、
私のRPi5環境では判定には2~3秒かかります
・small-int8(Beamsize:1)では
「ライト2を切って」===>「ライト2をきって」
※概ね正しく認識されますが
私のRPi5環境では判定には8~9秒かかり、ちょっと遅すぎる感じです
※認識時間はnucであれば早いとの情報もありますが、環境がないのでテストしていません。
Summary by CodeRabbit
New Features
Enhancements