User Dictionary Registration
This API is used for importing and exporting registered words in the user dictionary.
Retrieving Registered Words from User Dictionary
You can retrieve a list of registered words in JSON format.
Endpoint
GET https://acp-api.amivoice.com/profilewords/<dgn>/<pid>?adf=<adf>
Authentication
Please specify the APPKEY in the Authorization header.
Authorization: Bearer {APPKEY}
Request Parameters
Parameter Name | Parameter Name | Notes |
|---|---|---|
| dgn | Connection Engine Name | Specify a connection engine name such as -a-general. For available values, please see List of Speech Recognition Engines. Set it as a path parameter. |
| pid | Profile ID | Any string. Set it as a path parameter. |
| adf | Audio Data Format | Specify either 16k or 8k. If not specified, it defaults to 16k. Although some speech recognition engines support multiple sampling rates, user dictionary treats 8k and 16k as different engines, so you need to specify one. Set it as a query parameter. However, for End to End engines, 16k and 8k are treated as the same engine, so specification is not necessary. |
Retrieving Profile List
You can retrieve a list of profiles in JSON format.
Endpoint
GET https://acp-api.amivoice.com/profilewords/<dgn>/?adf=<adf>
Authentication
Please specify the APPKEY in the Authorization header.
Authorization: Bearer {APPKEY}
Request Parameters
Parameter Name | Parameter Name | Note |
|---|---|---|
| dgn | Connection engine name | Specify the connection engine name such as -a-general. For available values, please see List of Speech Recognition Engines. Set it as a path parameter. |
| adf | Audio data format | Specify either 16k or 8k. If not specified, it defaults to 16k. Although some speech recognition engines support multiple sampling rates, user dictionary is treated as different engines for 8k and 16k, so you need to specify one or the other. Set it as a query parameter. However, for End to End engines, 16k and 8k are treated as the same engine, so specification is not necessary. |
Registering Words in User Dictionary
You can replace words in the user dictionary for the specified speech recognition engine and profile ID.
Endpoint
POST https://acp-api.amivoice.com/profilewords/<dgn>/<pid>?adf=<adf>
Authentication
Please specify the APPKEY in the Authorization header.
Authorization: Bearer {APPKEY}
Request Parameters
Parameter Name | Parameter Name | Notes |
|---|---|---|
| dgn | Connection Engine Name | Specify a connection engine name such as -a-general. For available values, please see List of Speech Recognition Engines. Set it as a path parameter. |
| pid | Profile ID | Any string. Set it as a path parameter. |
| adf | Audio Data Format | Specify either 16k or 8k. If not specified, it defaults to 16k. Although some speech recognition engines support multiple sampling rates, user dictionary treats 8k and 16k as different engines, so you need to specify one. Set it as a query parameter. However, for End to End engines, 16k and 8k are treated as the same engine, so specification is not necessary. |
Content Type
Content-Type: application/json
Request Body
For Hybrid Engines
Field Name | Description | Notes |
|---|---|---|
profilewords | Word Registration Information | Specify the words you want to register in array format |
profilewords[].written | Written | Specify the written form of the word |
profilewords[].spoken | Pronunciation | Specify the pronunciation of the word |
profilewords[].classname | Class Name | Specify the class name. This can be omitted if not set. |
Example
{
"profilewords": [
{
"written": "AMI",
"spoken": "あみ",
},
{
"written": "AOI",
"spoken": "あおい",
},
{
"written": "躑躅森",
"spoken": "つつじもり",
"classname": "名前"
}
]
}
For End to End Engines
Field Name | Description | Notes |
|---|---|---|
profilewords | Keyword Biasing Information | Specify the words you want to boost in array format |
profilewords[].written | Written | Specify the written form of the word |
profilewords[].alternativewritten | Alternative Written | Specify the written form of the word to be replaced by the "Written" |
profilewords[].biasing | Biasing Level | Specify the strength of keyword biasing. Values from 0 to 1 can be specified, where 0 means no boost and 1 means strong boost at the cost of overall recognition accuracy. If not specified, it defaults to 0.5 |
It's possible to specify multiple alternative written for the same written. In this case, the same biasing level is applied to words with the same written. If different biasing levels are specified for the same written in the request, the value of the first occurrence in the request is adopted. In the following example, the biasing level for the same written "AMI" is uniformly applied with the value "0.8" which appears first. The biasing level for the third written "AOI" is applied with the default "0.5" as no specification is given.
Example
{
"profilewords": [
{
"written": "AMI",
"alternativewritten": "アドバンストメディア",
"biasing": 0.8
},
{
"written": "AMI",
"alternativewritten": "あみ"
},
{
"written": "AOI",
"alternativewritten": "あおい"
}
]
}
Response
On Success
HTTP Status Code: 200 OK
Response Body
For Hybrid Engines
Field Name | Description | Notes |
|---|---|---|
profilewords | Word Registration Information | Registered words are obtained in array format |
profilewords[].written | Written | The written form of the word is obtained |
profilewords[].spoken | Pronunciation | The pronunciation of the word is obtained |
profilewords[].classname | Class Name | The class name is returned. It is omitted if not set |
Example
{
"profilewords": [
{
"written": "AMI",
"spoken": "あみ",
},
{
"written": "AOI",
"spoken": "あおい",
},
{
"written": "躑躅森",
"spoken": "つつじもり",
"classname": "名前"
}
]
}
For End to End Engines
Field Name | Description | Notes |
|---|---|---|
profilewords | Keyword Biasing Information | The words to be boosted are returned in array format |
profilewords[].written | Written | The written form of the word is returned |
profilewords[].alternativewritten | Alternative Written | The written form of the word to be replaced by the "Written" is returned |
profilewords[].biasing | Biasing Level | The strength of keyword biasing is returned. It is omitted when the value is the default 0.5 |
Example
{
"profilewords": [
{
"written": "AMI",
"alternativewritten": "あみ",
"biasing": 0.8
},
{
"written": "AMI",
"alternativewritten": "アドバンストメディア",
"biasing": 0.8
},
{
"written": "AOI",
"alternativewritten": "あおい"
}
]
}
On Failure
HTTP Status Code: Other than 200
Response Body
Field Name | Description | Notes |
|---|---|---|
| code | Error Code | Code indicating the type of error |
| message | Error Message | Text explaining the details of the error content |
Error Codes and Error Messages
HTTP Status Code | Response Body | Error Situation |
|---|---|---|
| 404 Not Found | {"code":"?","message":"missing dictation grammar file name"} | When the dictation grammar file name <dgn> is not specified |
| 404 Not Found | {"code":"?","message":"missing profile id"} | When the profile ID <pid> is not specified |
| 405 Method Not Allowed | {"code":"?","message":"POST method is not allowed"} | When POST is specified |
| 400 Bad Request | {"code":"-","message":"missing request body"} | When a POST method is requested but no request body is specified |
| 400 Bad Request | {"code":"-","message":"invalid request body (<optionalMessage>)"} | When the request body is not valid JSON |
| 422 Unprocessable Entity | {"code":"?","message":"missing profile words"} | When the JSON specified in the request body is not in the expected format |
| 422 Unprocessable Entity | {"code":"?","message":"invalid written: <written>"} | When the written in the JSON specified in the request body is incorrect |
| 422 Unprocessable Entity | {"code":"?","message":"invalid spoken: <spoken>"} | When the pronunciation in the JSON specified in the request body is incorrect |
| 422 Unprocessable Entity | {"code":"?","message":"invalid className: <className>"} | When the word class in the JSON specified in the request body is incorrect |
| 422 Unprocessable Entity | {"code":"?","message":"invalid alternative written: <alternativeWritten>"} | When the alternative written in the JSON specified in the request body is incorrect |
| 401 Unauthorized | {"code":"-","message":"can't verify service authorization"} | When authentication of the APPKEY (service authentication key string) fails |
| 401 Unauthorized | {"code":"-","message":"service authorization has expired: <expirationTime> (<expiresIn>)"} | When authentication of the APPKEY (service authentication key string) fails |
| 500 Internal Server Error | {"code":"?","message":"unexpected exception occurred (<optionalMessage>)"} | When an unexpected exception occurs |
Example
{
"code":"?",
"message":"missing dictation grammar file name"
}