Skip to content

Commit

Permalink
[4.3] KZOO-103: add smart formatting to remove hesitations (#6679)
Browse files Browse the repository at this point in the history
* ibm dnt hesitate

* add config apis

* fix code

* change profinatily filter to true
  • Loading branch information
holy-batman authored Dec 18, 2020
1 parent b5fc652 commit 3b1f127
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions applications/crossbar/priv/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -35397,9 +35397,15 @@
"type": "string"
},
"asr_profanity_filter": {
"default": true,
"description": "speech ibm asr_profanity_filter",
"type": "boolean"
},
"asr_smart_formatting": {
"default": true,
"description": "speech ibm asr_smart_formatting",
"type": "boolean"
},
"asr_url": {
"description": "speech ibm asr_url",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@
"type": "string"
},
"asr_profanity_filter": {
"default": true,
"description": "speech ibm asr_profanity_filter",
"type": "boolean"
},
"asr_smart_formatting": {
"default": true,
"description": "speech ibm asr_smart_formatting",
"type": "boolean"
},
"asr_url": {
"description": "speech ibm asr_url",
"type": "string"
Expand Down
4 changes: 3 additions & 1 deletion core/kazoo_speech/src/asr/kazoo_asr_ibm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
-define(IBM_CONFIG_CAT, <<(?MOD_CONFIG_CAT)/binary, ".ibm">>).
-define(IBM_ASR_URL, kapps_config:get_binary(?IBM_CONFIG_CAT, <<"asr_url">>)).
-define(IBM_ASR_KEY, kapps_config:get_binary(?IBM_CONFIG_CAT, <<"asr_api_key">>)).
-define(IBM_ASR_PROFANITY_FILTER, kapps_config:get_is_true(?IBM_CONFIG_CAT, <<"asr_profanity_filter">>)).
-define(IBM_ASR_PROFANITY_FILTER, kapps_config:get_is_true(?IBM_CONFIG_CAT, <<"asr_profanity_filter">>, 'true')).
-define(IBM_ASR_MODEL, kapps_config:get_binary(?IBM_CONFIG_CAT, <<"asr_model">>, <<"en-US_NarrowbandModel">>)).
-define(IBM_ASR_SMART_FORMATTING, kapps_config:get_is_true(?IBM_CONFIG_CAT, <<"asr_smart_formatting">>, 'true')).
-define(IBM_ASR_PREFERRED_CONTENT_TYPE, <<"audio/mpeg">>).
-define(IBM_ASR_ACCEPTED_CONTENT_TYPES, [<<"audio/mpeg">>, <<"audio/wav">>]).

Expand Down Expand Up @@ -85,6 +86,7 @@ build_url() ->
props:filter_undefined(
[{<<"profanity_filter">>, ?IBM_ASR_PROFANITY_FILTER}
,{<<"model">>, ?IBM_ASR_MODEL}
,{<<"smart_formatting">>, ?IBM_ASR_SMART_FORMATTING}
])
)
of
Expand Down

0 comments on commit 3b1f127

Please sign in to comment.