灵云人工智能论坛

 找回密码
 立即注册
搜索
查看: 13863|回复: 0

SDK几个常用的高频配置 [复制链接]

Rank: 10Rank: 10Rank: 10

超级版主 活跃会员 突出贡献 优秀版主 荣誉管理 论坛元老 智多星 小助手 大助手

发表于 2017-7-10 08:38:37 |显示全部楼层

几个常用的高频配置

设置授权文件存放路径:

initparam.addParam(InitParam.AuthParam.PARAM_KEY_AUTH_PATH,authDirPath);

设置日志文件存放路径:

initparam.addParam(InitParam.LogParam.PARAM_KEY_LOG_FILE_PATH,logPath);

设置本地资源文件存放路径:

asrInitParam.addParam(AsrInitParam.PARAM_KEY_DATA_PATH,dataPath);

*如果是以lib.so形式加载的,需要加上如下一句:

String dataPath =getFilesDir().getPath().replace("files", "lib");

设置udidtype:

initparam.addParam("udidtype","wifiid");

asr设置输入音频格式:

asrConfig.addParam(AsrConfig.AudioConfig.PARAM_KEY_AUDIO_FORMAT,

AsrConfig.AudioConfig.VALUE_OF_PARAM_AUDIO_FORMAT_PCM_16K16BIT);

asr设置音频压缩格式:

asrConfig.addParam(AsrConfig.AudioConfig.PARAM_KEY_ENCODE,“speex”);

asr设置端点检测头部参数、尾部参数,打开端点检测开关,设置灵敏度:

asrConfig.addParam(AsrConfig.VadConfig.PARAM_KEY_VAD_HEAD,"10000");

asrConfig.addParam(AsrConfig.VadConfig.PARAM_KEY_VAD_TAIL,"500");

asrConfig.addParam(AsrConfig.VadConfig.PARAM_KEY_VADSWITCH,"yes");

asrConfig.addParam(AsrConfig.VadConfig.PARAM_KEY_VADTHRESHOLD,"10");

asr.cloud.dialog添加intention意图领域:

asrConfig.addParam(AsrConfig.SessionConfig.PARAM_KEY_INTENTION,

"weather");

设置资源文件以android_so的形式加载(SDK5.2.8缺省值:none,采用copyAssetfiles的方式):

asrInitParam.addParam(AsrInitParam.PARAM_KEY_FILE_FLAG,

AsrInitParam.VALUE_OF_PARAM_FILE_FLAG_ANDROID_SO);

添加资源文件前缀:

ttsConfig.addParam(TtsConfig.SessionConfig.PARAM_KEY_RES_PREFIX,"Xiaokun_")

调用私有云设置property参数:

ttsConfig.addParam("property","cn_xiaokun_common");

tts调节音量、语速和基频:

ttsConfig.addParam(TtsConfig.BasicConfig.PARAM_KEY_VOLUME,"8");

ttsConfig.addParam(TtsConfig.BasicConfig.PARAM_KEY_SPEED,"5");

ttsConfig.addParam(TtsConfig.BasicConfig.PARAM_KEY_PITCH,"5");

NLU设置机器人哈希值(robotid):

recogConfig.addParam("robotid","2e79dce7d3d4f54b3db67a4962643880");

NLU设置渠道号:

recogConfig.addParam("channelid","2");

NLU设置intention意图识别领域:

recogConfig.addParam("intention","weather");

NLU设置是否返回上下文(context):

recogConfig.addParam("context","yes");

NLU设置是否返回意图识别结果(needcontent):

recogConfig.addParam("needcontent","yes");

NLU本地识别设置返回的意图结果个数:

recogConfig.addParam("candidateCount","10");

OCR本地模板识别设置模板路径:

String ocrTemplatePath = sPath+"\\data\\templates\\IDCard\\iRead_IDCard_encode.xml";

OCR设置模板索引和模板页索引:

recogConfig.addParam(OcrConfig.TemplateConfig.PARAM_KEY_TEMPLATE_INDEX,

"0");

recogConfig.addParam(OcrConfig.TemplateConfig.PARAM_KEY_TEMPLATE_PATE_INDEX,"0");

HWR上传用户数据:

//initParam.addParam(HwrInitParam.PARAM_KEY_AUTO_UPLOAD,"yes");

HWR设置识别范围:

recogConfig.addParam(HwrConfig.ResultConfig.PARAM_KEY_RECOG_RANGE,"all";

HWR设置行写和叠写(英文叠写不支持)

recogConfig.addParam(HwrConfig.InputConfig.PARAM_KEY_SPLIT_MODE,"line";

HWR设置候选词个数:

recogConfig.addParam(HwrConfig.ResultConfig.PARAM_KEY_CAND_NUM,"10";

HWR设置简繁体转换:

recogConfig.addParam(HwrConfig.ResultConfig.PARAM_KEY_DISP_CODE,"nochange");

HWR设置实时修正的实时识别:

recogConfig.addParam("realtime","no");

KB设置中文输入模式:

recogConfig.addParam(KbConfig.InputConfig.PARAM_KEY_INPUT_MODE,"pinyin");

KB设置键盘布局:

recogConfig.addParam(KbConfig.InputConfig.PARAM_KEY_KEYBOARD, "t9");

KB设置qwerty键盘容错等级:

recogConfig.addParam(KbConfig.InputConfig.PARAM_KEY_faultTolerantLevel, "none");

vpr注册用户userid:

enrollConfig.addParam(VprConfig.UserConfig.PARAM_KEY_USER_ID,"123456");

vpr传如本地用户模型:

sessionConfig.addParam(VprConfig.SessionConfig.PARAM_KEY_USER_MODEL_PATH,Environment.getExternalStorageDirectory()+"");

vpr设置判别的阈值:

verifyConfig.addParam(VprConfig.UserConfig.PARAM_KEY_THRESHOLD,"80");

vpr辨识传入用户组:

identifyConfig.addParam(VprConfig.UserConfig.PARAM_KEY_GROUP_ID,group_id);


踩过的脚印

举报

您需要登录后才可以回帖 登录 | 立即注册

Archiver|任务|灵云 ( 京ICP证030095号 )

GMT+8, 2020-10-23 07:45 , Processed in 0.085362 second(s), 19 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部