Deep learning 如何在培训和推理过程中有效地使用Deespeech(v0.5.1)和使用语言模型?

Deep learning 如何在培训和推理过程中有效地使用Deespeech(v0.5.1)和使用语言模型?,deep-learning,speech-to-text,language-model,mozilla-deepspeech,Deep Learning,Speech To Text,Language Model,Mozilla Deepspeech,我正在尝试训练和使用一个使用英语Deepspeech v0.5.1的模型。我的目标是训练两个模型,一个有语言模型,一个没有语言模型。请在几个方面寻求你的帮助。抱歉,这很长,但请尽量详细;而且,作为Linux和数据科学的新手,我可能会说一些非常明显的事情。 提前感谢您的帮助。既然如此说,原来的形式是垃圾邮件,我张贴和回答这个问题与进一步的背景资料。 当做 罗希特 B) 我的问题是: B1)当使用语言模型进行训练或推理时,我是否必须指定lm_二进制参数和相应的trie文件?仅使用trie可以工作吗

我正在尝试训练和使用一个使用英语Deepspeech v0.5.1的模型。我的目标是训练两个模型,一个有语言模型,一个没有语言模型。请在几个方面寻求你的帮助。抱歉,这很长,但请尽量详细;而且,作为Linux和数据科学的新手,我可能会说一些非常明显的事情。 提前感谢您的帮助。既然如此说,原来的形式是垃圾邮件,我张贴和回答这个问题与进一步的背景资料。 当做 罗希特

B) 我的问题是:

B1)当使用语言模型进行训练或推理时,我是否必须指定lm_二进制参数和相应的trie文件?仅使用trie可以工作吗

B2)无论在训练模型时是否使用了语言模型(binaryFile和trie一起),稍后当模型用于推理时,我可以选择使用还是不使用语言模型吗?以后是否可以使用不同的语言模型,或者仅使用用于培训的语言模型?在选择替代车型时,是否有需要注意的事项?例如,使用3-gram模型进行培训,但在推理过程中使用4-gram模型?你还能想到其他类似的事情吗

B3)假设我的模型已经在词汇表文件上进行了训练,arpa、trie和lm_二进制文件仅从10k数据点构建。假设我从一个比用于培训的语料库更大的语料库中创建了一个名为BigVocability.file的新词汇表。例如,validated.tsv文件中的整个629731数据点;使用更大的词汇表创建.arpa、lmBinary和trie文件。我通过比较字母表文件来确保有效字符完全相同。然后,在使用较小词汇表训练的模型上,我可以在使用命令进行推理时使用bigtology.binary.file和bigtology.trie吗

我已经创建了一个只有前1000个文件的模型,虽然推断很差,但仍然有效。 命令:

深刻的演讲\ --model/home/rohit/dpspTraining/models/v051/model8-validFirst1k-yesLM-4gram/savedModel/output_graph.pb\ --alphabet/home/rohit/dpspTraining/data/wavFiles/commVoiceSet5-1kTotal/alphabetDir/alphabet-Set5First1050.txt\ --lm/home/rohit/dpspTraining/data/wavFiles/commVoiceSet5-1kTotal/lm/lm4gram/词汇表-Set5First1050_4gram.klm\ --trie/home/rohit/dpspTraining/data/wavFiles/commVoiceSet5-1kTotal/trie/trie4gram/Set5First1050_4gram.trie\ --音频/home/rohit/dpspTraining/data/wavFiles/wav33/test/File28

控制台输出:

(dpsp5v051basic)rohit@DE-W-0246802:~/dpspCODE/v051/DeepSpeech$DeepSpeech\ --model/home/rohit/dpspTraining/models/v051/model8-validFirst1k-yesLM-4gram/savedModel/output_graph.pb\ --alphabet/home/rohit/dpspTraining/data/wavFiles/commVoiceSet5-1kTotal/alphabetDir/alphabet-Set5First1050.txt\ --lm/home/rohit/dpspTraining/data/wavFiles/commVoiceSet5-1kTotal/lm/lm4gram/词汇表-Set5First1050_4gram.klm\ --trie/home/rohit/dpspTraining/data/wavFiles/commVoiceSet5-1kTotal/trie/trie4gram/Set5First1050_4gram.trie\ --音频/home/rohit/dpspTraining/data/wavFiles/wav33/test/File28.wav 从文件/home/rohit/dpspTraining/models/v051/model8-validFirst1k-yesLM-4gram/savedModel/output_graph.pb加载模型 TensorFlow:v1.13.1-10-g3e0cc53 DeepSpeech:v0.5.1-0-g4b29b78 警告:正在将整个模型文件读取到内存中。将模型文件转换为MMAP图以减少堆的使用。 2019-08-01 16:11:02.155443:I tensorflow/core/platform/cpu_feature_guard.cc:141]您的cpu支持该tensorflow二进制文件未编译为使用的指令:AVX2 FMA 2019-08-01 16:11:02.179690:E tensorflow/core/framework/op_kernel.cc:1325]OpKernel(“op:“UnwrapDatasetVariant”设备类型:“CPU”)用于未知op:UnwrapDatasetVariant 2019-08-01 16:11:02.179740:E tensorflow/core/framework/op_kernel.cc:1325]OpKernel('op:“WrapDatasetVariant”设备类型:“GPU”主机内存参数:“input_handle”主机内存参数:“output_handle”)用于未知op:WrapDatasetVariant 2019-08-01 16:11:02.179756:E tensorflow/core/framework/op_kernel.cc:1325]OpKernel(op:“WrapDatasetVariant”设备类型:“CPU”)用于未知op:WrapDatasetVariant 2019-08-01 16:11:02.179891:E tensorflow/core/framework/op_kernel.cc:1325]OpKernel('op:“UnwrapDatasetVariant”设备类型:“GPU”主机内存参数:“input_handle”主机内存参数:“output_handle”)用于未知op:UnwrapDatasetVariant 在0.0283s中加载模型。 从文件/home/rohit/dpspTraining/data/wavFiles/commVoiceSet5-1ktall/lm/lm4gram/词汇表-Set5First1050_4gram.klm/home/rohit/dpspTraining/data/wavFiles/commVoiceSet5-1ktall/trie/trie4gram/Set5First1050_4gram.trie加载语言模型 已在0.068s中加载语言模型。 运行推理。 a中的a是 3.041s音频文件的推断时间为0.449s

但是如果我使用bigtoolkacy.trie和lmBinary文件,那么我会得到一个错误,说trie文件版本不匹配,并更新trie文件

但它似乎仍在加载语言模型。那么Deepspeech是否真的能够正确地使用它呢?如何修复此错误

命令:

深刻的演讲\ --model/home/rohit/dpspTraining/models/v051/model8-validFirst1k-yesLM-4gram/savedModel/output_graph.pb\ --alphabet/home/rohit/dpspTraining/data/wavFiles/commVoiceSet5-1kTotal/alphabetDir/alphabet-Set5First1050.txt\ --lm/home/rohit/dpspTraining/data/wavFiles/testvocaballvalized/lm/lm4gram/词汇表-allValidated_o4gram.klm\ --trie/home/rohit/dpspTraining/data/wavFiles/testvocaballvalized/trie/trie4gram/allValidated_o4gram.trie\ --音频/home/rohit/dpspTraining/data/wavFiles/wav33/test/File28.wav

控制台输出:

(dpsp5v051basic)rohit@DE-W-0246802:~/dpspCODE/v051/DeepSpeech$DeepSpeech\

--model/home/rohit/dpspTraining/models/v051/model8-validFirst1k-yesLM-4gram/savedModel/output_graph.pb\ --字母表/主页/罗希特/dp