当前位置: 首页>>代码示例>>Python>>正文


Python deepspeech.Model方法代码示例

本文整理汇总了Python中deepspeech.Model方法的典型用法代码示例。如果您正苦于以下问题:Python deepspeech.Model方法的具体用法?Python deepspeech.Model怎么用?Python deepspeech.Model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在deepspeech的用法示例。


在下文中一共展示了deepspeech.Model方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import deepspeech [as 别名]
# 或者: from deepspeech import Model [as 别名]
def __init__(self):
		super().__init__()
		self._capableOfArbitraryCapture = True
		self._isOnlineASR = False

		self._langPath = Path(self.Commons.rootDir(), f'trained/asr/deepspeech/{self.LanguageManager.activeLanguage}')

		self._model: Optional[deepspeech.Model] = None
		self._triggerFlag = self.ThreadManager.newEvent('asrTriggerFlag')
		self._vadTemporisation: Optional[threading.Timer] = None 
开发者ID:project-alice-assistant,项目名称:ProjectAlice,代码行数:12,代码来源:DeepSpeechASR.py

示例2: __init__

# 需要导入模块: import deepspeech [as 别名]
# 或者: from deepspeech import Model [as 别名]
def __init__(self, path=DEFAULT_MODEL_PATH):
        logger.info('Loading model from: {}...'.format(path))

        self.model = Model(path, self.N_FEATURES, self.N_CONTEXT, self.alphabet_path, self.BEAM_WIDTH)
        self.model.enableDecoderWithLM(self.alphabet_path, self.lm_path, self.trie_path, self.LM_ALPHA, self.LM_BETA)

        logger.info('Loaded model') 
开发者ID:IBM,项目名称:MAX-Speech-to-Text-Converter,代码行数:9,代码来源:model.py

示例3: onStart

# 需要导入模块: import deepspeech [as 别名]
# 或者: from deepspeech import Model [as 别名]
def onStart(self):
		super().onStart()

		if not self.checkLanguage():
			self.downloadLanguage()

		self._model = deepspeech.Model(f'{self._langPath}/deepspeech-0.6.1-models/output_graph.tflite', 500)
		self._model.enableDecoderWithLM(f'{self._langPath}/deepspeech-0.6.1-models/lm.binary', f'{self._langPath}/deepspeech-0.6.1-models/trie', 0.75, 1.85) 
开发者ID:project-alice-assistant,项目名称:ProjectAlice,代码行数:10,代码来源:DeepSpeechASR.py

示例4: _get_model

# 需要导入模块: import deepspeech [as 别名]
# 或者: from deepspeech import Model [as 别名]
def _get_model(self) -> deepspeech.Model:
        if not self._model:
            self._model = deepspeech.Model(self.model_file, self.beam_width)
            self._model.enableDecoderWithLM(self.lm_file, self.trie_file, self.lm_alpha, self.lm_beta)

        return self._model 
开发者ID:BlackLight,项目名称:platypush,代码行数:8,代码来源:deepspeech.py

示例5: __init__

# 需要导入模块: import deepspeech [as 别名]
# 或者: from deepspeech import Model [as 别名]
def __init__(self):
        deepspeech_dir = os.path.join(os.path.dirname(__file__), 'resources/deepspeech')
        model_path = os.path.join(deepspeech_dir, 'output_graph.pbmm')
        alphabet_path = os.path.join(deepspeech_dir, 'alphabet.txt')
        language_model_path = os.path.join(deepspeech_dir, 'lm.binary')
        trie_path = os.path.join(deepspeech_dir, 'trie')

        # https://github.com/mozilla/DeepSpeech/blob/master/native_client/python/client.py
        self._model = Model(model_path, 500)
        self._model.enableDecoderWithLM(language_model_path, trie_path, 0.75, 1.85) 
开发者ID:Picovoice,项目名称:speech-to-text-benchmark,代码行数:12,代码来源:engine.py

示例6: init_stt

# 需要导入模块: import deepspeech [as 别名]
# 或者: from deepspeech import Model [as 别名]
def init_stt(output_graph_path, scorer_path):
    global model
    model = deepspeech.Model(output_graph_path)
    model.enableExternalScorer(scorer_path)
    logging.debug('Process {}: Loaded models'.format(os.getpid())) 
开发者ID:mozilla,项目名称:DSAlign,代码行数:7,代码来源:align.py


注:本文中的deepspeech.Model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。