How to Use Registered Words
This section explains how to activate words that have been saved to a profile using the pre-registration method.
Usage Method
In addition to the speech recognition engine (grammarFileNames
) in the request parameters for speech recognition, set the profile ID (profileId
). The words registered in the profile will be active during that request session.
grammarFileNames={connection engine name} profileId=:{profile ID}
- For
profileId
, specify the profile name preceded by a ":" (colon). - Profiles are distinguished by speech recognition engine, so set the
grammarFileNames
specified during word registration in the request as well. - If registered from the My Page, set the user ID as the profile ID.
The system will work even without the ":" at the beginning of the profileId, but recognition accuracy may decrease.
If both profileId
and profileWords
are specified simultaneously, profileWords
takes precedence. The words already registered in the profile will not be activated.
For example, if you make a request with the "会話_汎用" engine (-a-general
), setting profileId
to ":test" and profileWords
to "AMI あみ" as follows, the words saved in the profile specified by profileId
will not be activated in this session. Only "AMI あみ" set in profileWords
will be active.
grammarFileNames=-a-general profileId=:test profileWords="AMI あみ"
Testing Word Registration
Download the audio file (www.wav) and copy it to the directory where you will execute the command. It contains the recorded utterance "とりぷるだぶる". Run the sample with the following parameters:
{Service ID}
is the [サービス ID] displayed in the connection information on your My Page. Add a ":" to the beginning. For example, if the service ID is user01, it should be :user01.{APP_KEY}
is the [APPKEY] displayed on your My Page.
curl https://acp-api.amivoice.com/v1/recognize \
-F u={APP_KEY} \
-F d="grammarFileNames=-a-general profileId=:{Service ID}" \
-F a=@www.wav
In the JavaScript version sample, you can confirm the effect of word registration with the following steps:
- Open WrpTester.html or wrp.html in a browser (except IE).
- In [プロファイル ID], enter the string with ":" added to the beginning of the [サービス ID] from your My Page.
- In [APPKEY], enter the [APPKEY] from your My Page.
- Click the [録音開始] button and say "とりぷるだぶる".
For instructions on how to run the JavaScript sample by obtaining a one-time APPKEY, please see here.