public class AILocalASRIntent
extends java.lang.Object
构造器和说明 |
---|
AILocalASRIntent() |
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getBlackWords() |
java.util.Map<java.lang.String,java.lang.Double> |
getCustomThreshold() |
java.lang.String |
getDynamicList() |
java.lang.String |
getExpandFnPath() |
IFespxEngine |
getFespxEngine() |
float |
getFillerPenaltyScore() |
int |
getIntervalTimeThresh() |
int |
getMaxSpeechTimeS() |
ASRMode |
getMode()
获取引擎模式,默认
ASRMode.MODE_ASR |
int |
getNoSpeechTimeOut() |
int |
getPauseTime() |
java.lang.String |
getSaveAudioPath() |
double |
getThreshold() |
float |
getThreshToUploadServer() |
java.lang.String |
getUseDelimiter() |
java.lang.Boolean |
getVadEnable() |
java.lang.String |
getWords() |
boolean |
isUseConf() |
boolean |
isUseCustomFeed() |
boolean |
isUseFiller() |
boolean |
isUseHoldConf() |
boolean |
isUseOneShot() |
boolean |
isUsePinyin() |
boolean |
isUseRealBack() |
boolean |
isUseXbnfRec() |
void |
setBlackWords(java.lang.String blackWords) |
void |
setBlackWords(java.lang.String[] blackWords)
设置热词黑名单
|
void |
setCustomThreshold(java.util.Map<java.lang.String,java.lang.Double> customThreshold) |
void |
setCustomThreshold(java.lang.String[] words,
java.lang.Double[] threshold)
自定义单词置信度阈值
|
void |
setDynamicList(java.util.List<java.lang.String> dynamicList)
设置识别热词列表字符串,比如:"北京市,YOU ARE RIGHT,BLUCE,tfboys,天安门博物馆"
|
void |
setDynamicList(java.lang.String dynamicList) |
void |
setExpandFnPath(java.lang.String expandFnPath)
ExpandFn 文件路径,用于动态拆分net.bin文件
start 之前传入有效
|
void |
setFespxEngine(IFespxEngine fespxEngine)
设置关联的信号处理引擎AILocalSignalAndWakeupEngine实例,只在使用内部录音机且多麦模式下才需要设置
|
void |
setFillerPenaltyScore(float fillerPenaltyScore) |
void |
setIntervalTimeThresh(int intervalTimeThresh) |
void |
setMaxSpeechTimeS(int maxSpeechTimeS)
设置音频最大录音时长,达到该值将取消语音引擎并抛出异常
允许的最大录音时长 单位秒,取值范围 1-60秒,默认60秒 |
void |
setMode(ASRMode mode)
设置引擎模式
|
void |
setNoSpeechTimeOut(int noSpeechTimeOut)
设置无语音超时时长,单位毫秒,默认值为5000ms ;如果达到该设置值时,自动停止录音并放弃请求识别内核
|
void |
setPauseTime(int pauseTime)
设置VAD右边界
|
void |
setSaveAudioPath(java.lang.String saveAudioPath)
设置保存的音频路径,最终的音频路径为path + local_asr_+ recordId + ".pcm"
|
void |
setThreshold(double threshold)
设置置信度阈值
|
void |
setThreshToUploadServer(float threshToUploadServer)
上传大数据的阈值,识别后的结果包含置信度,启动上传大数据功能后,如果达不到阈值就会上传大数据
默认为1,即启动上传大数据功能后,所有音频都可以上传大数据
|
void |
setUseConf(boolean useConf)
设置是否开启置信度
|
void |
setUseCustomFeed(boolean useCustomFeed)
设置是否自行feed数据,不使用内部录音机(包括MockRecord和AIAudioRecord),默认为false
|
void |
setUseDelimiter(java.lang.String useDelimiter)
添加识别结果分割符,如设置 "," 识别结果显示 : "打,开,天,窗"
start 之前设置生效
|
void |
setUseFiller(boolean useFiller)
设置是否开启 Filler,用于减少误识别。
|
void |
setUseFiller(boolean useFiller,
float fillerPenaltyScore)
设置是否开启 Filler,用于减少误识别。
|
void |
setUseHoldConf(boolean useHoldConf)
设置是否开启ngram置信度
|
void |
setUseOneShot(boolean useOneShot)
是否使用oneshot功能,default is false
true 使用one shot功能,唤醒后立马起识别 false 不使用oneshot,合成后启动识别,或只是启动识别 |
void |
setUseOneShot(boolean useOneShot,
int intervalTimeThresh)
设置是否使用oneshot功能,以及oneshot功能的唤醒词和命令词之间的时间间隔阈值,
如果小于该阈值,就认为不是oneshot,如果大于该阈值,就认为是oneshot
|
void |
setUsePinyin(boolean usePinyin)
设置是否开启拼音输出
|
void |
setUseRealBack(boolean useRealBack)
设置是否开启实时反馈
|
void |
setUseXbnfRec(boolean useXbnfRec)
设置是否启用基于语法的语义识别
|
void |
setVadEnable(java.lang.Boolean vadEnable)
设置是否启用本地vad。
|
void |
setWords(java.lang.String words)
直接按照内核既定格式设置词表如: \"打开副屏,打开今日头条\"
|
void |
setWords(java.lang.String[] words)
设置词表
|
java.lang.String |
toString() |
public IFespxEngine getFespxEngine()
public void setFespxEngine(IFespxEngine fespxEngine)
fespxEngine
- 引擎实例java.lang.RuntimeException
- 内部录音机且多麦模式下没设置public void setNoSpeechTimeOut(int noSpeechTimeOut)
noSpeechTimeOut
- 超时时长,单位毫秒public void setMaxSpeechTimeS(int maxSpeechTimeS)
maxSpeechTimeS
- secondspublic void setWords(java.lang.String[] words)
words
- 词表public void setWords(java.lang.String words)
words
- 内核词表public void setBlackWords(java.lang.String[] blackWords)
blackWords
- 黑名单词表public void setThreshold(double threshold)
threshold
- 阈值public void setCustomThreshold(java.lang.String[] words, java.lang.Double[] threshold)
words
- 词表threshold
- 阈值public void setSaveAudioPath(java.lang.String saveAudioPath)
saveAudioPath
- 路径public void setIntervalTimeThresh(int intervalTimeThresh)
public void setDynamicList(java.lang.String dynamicList)
public void setFillerPenaltyScore(float fillerPenaltyScore)
public java.util.Map<java.lang.String,java.lang.Double> getCustomThreshold()
public void setCustomThreshold(java.util.Map<java.lang.String,java.lang.Double> customThreshold)
public java.lang.String getWords()
public java.lang.String getBlackWords()
public void setBlackWords(java.lang.String blackWords)
public double getThreshold()
public ASRMode getMode()
ASRMode.MODE_ASR
public void setMode(ASRMode mode)
mode
- 默认ASRMode.MODE_ASR
public void setUseOneShot(boolean useOneShot)
useOneShot
- true 使用 oneshot功能,false 不使用public void setUseOneShot(boolean useOneShot, int intervalTimeThresh)
useOneShot
- true 使用 oneshot功能,false 不使用intervalTimeThresh
- useOneShot 为 true 时才有效,单位:毫秒,默认为600ms。public java.lang.String getUseDelimiter()
public void setUseDelimiter(java.lang.String useDelimiter)
useDelimiter
- 分割符public void setUseConf(boolean useConf)
useConf
- true 启用,默认为truepublic java.lang.String getExpandFnPath()
public void setExpandFnPath(java.lang.String expandFnPath)
expandFnPath
- ExpandFn 文件的绝对路径
slots 文件示例{"slot": [{"name": "DEVICE","path": "device.slot.bin" }, {"name": "WAKEUP_WORD","path": "wakeup_word.slot.bin" }]}public void setUseXbnfRec(boolean useXbnfRec)
useXbnfRec
- true 启用,默认为falsepublic void setUseRealBack(boolean useRealBack)
useRealBack
- useRealBack,默认为falsepublic void setUseHoldConf(boolean useHoldConf)
useHoldConf
- useRealBack,默认为truepublic void setUsePinyin(boolean usePinyin)
usePinyin
- usePinyin,默认为falsepublic void setDynamicList(java.util.List<java.lang.String> dynamicList)
dynamicList
- 热词列表字符串public void setUseCustomFeed(boolean useCustomFeed)
useCustomFeed
- the useCustomFeed to setpublic int getIntervalTimeThresh()
public boolean isUseOneShot()
public boolean isUseConf()
public int getNoSpeechTimeOut()
public int getMaxSpeechTimeS()
public java.lang.String getSaveAudioPath()
public boolean isUseXbnfRec()
public boolean isUseRealBack()
public boolean isUseHoldConf()
public boolean isUsePinyin()
public java.lang.String getDynamicList()
public boolean isUseCustomFeed()
public int getPauseTime()
public void setPauseTime(int pauseTime)
pauseTime
- pauseTime 单位:ms,默认300public boolean isUseFiller()
public void setUseFiller(boolean useFiller)
设置是否开启 Filler,用于减少误识别。
例如:asr.xbnf 里有词 “周杰伦的歌”,用户只说了 “周杰伦”。当使用热词时,Filler 功能一定会打开,开关设置无效
useFiller
- true 使用Filler,false 不使用(default)public float getFillerPenaltyScore()
public void setUseFiller(boolean useFiller, float fillerPenaltyScore)
设置是否开启 Filler,用于减少误识别。
例如:asr.xbnf 里有词 “周杰伦的歌”,用户只说了 “周杰伦”。当使用热词时,Filler 功能一定会打开,开关设置无效,惩罚分数设置仍然有效
useFiller
- true 使用Filler,false 不使用(default)fillerPenaltyScore
- 惩罚分数,default is 2.0。使用Filler时这个参数才有效public java.lang.Boolean getVadEnable()
public void setVadEnable(java.lang.Boolean vadEnable)
AILocalASRConfig.isVadEnable()
为true,否则该参数无效。
此参数可设置本轮start的引擎是否使用vad功能vadEnable
- null 使用和AILocalASRConfig.isVadEnable()
一样的设置, true 使用Vad, false 禁止Vadpublic float getThreshToUploadServer()
public void setThreshToUploadServer(float threshToUploadServer)
默认为1,即启动上传大数据功能后,所有音频都可以上传大数据
threshToUploadServer
- 阈值 取值范围 0-1public java.lang.String toString()
toString
在类中 java.lang.Object