mirror of
https://github.com/leon-ai/leon.git
synced 2024-11-28 12:43:35 +03:00
Merge branch 'update-deepspeech' into develop
This commit is contained in:
commit
f5ab281af1
12
package-lock.json
generated
12
package-lock.json
generated
@ -10183,14 +10183,14 @@
|
||||
}
|
||||
},
|
||||
"npm-bundled": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz",
|
||||
"integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g=="
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz",
|
||||
"integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g=="
|
||||
},
|
||||
"npm-packlist": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz",
|
||||
"integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.0.tgz",
|
||||
"integrity": "sha512-zCAmKshsFx2MhOsXdYmZd1DO2d8ts80kVASSWX6lv8654i0edCnNCoEqwVsMygl1BSroCPW6Zh5Dcw+ann775g==",
|
||||
"requires": {
|
||||
"ignore-walk": "^3.0.1",
|
||||
"npm-bundled": "^1.0.1"
|
||||
|
@ -54,7 +54,7 @@
|
||||
"aws-sdk": "^2.382.0",
|
||||
"body-parser": "^1.17.2",
|
||||
"cross-env": "^5.2.0",
|
||||
"deepspeech": "^0.4.0",
|
||||
"deepspeech": "^0.4.1",
|
||||
"dotenv": "^4.0.0",
|
||||
"execa": "^0.10.0",
|
||||
"express": "^4.15.3",
|
||||
|
@ -12,7 +12,7 @@ export default () => new Promise(async (resolve, reject) => {
|
||||
|
||||
const destDeepSpeechFolder = 'bin/deepspeech'
|
||||
const tmpDir = 'scripts/tmp'
|
||||
const archiveName = 'deepspeech-0.4.0-models.tar.gz'
|
||||
const archiveName = 'deepspeech-0.4.1-models.tar.gz'
|
||||
let downloader = 'wget'
|
||||
if (os.get().type === 'macos') {
|
||||
downloader = 'curl -L -O'
|
||||
@ -21,7 +21,7 @@ export default () => new Promise(async (resolve, reject) => {
|
||||
if (!fs.existsSync(`${destDeepSpeechFolder}/lm.binary`)) {
|
||||
try {
|
||||
log.info('Downloading pre-trained model...')
|
||||
await shell(`cd ${tmpDir} && ${downloader} https://github.com/mozilla/DeepSpeech/releases/download/v0.4.0/${archiveName}`)
|
||||
await shell(`cd ${tmpDir} && ${downloader} https://github.com/mozilla/DeepSpeech/releases/download/v0.4.1/${archiveName}`)
|
||||
log.success('Pre-trained model download done')
|
||||
log.info('Unpacking...')
|
||||
await shell(`cd ${tmpDir} && tar xvfz ${archiveName}`)
|
||||
|
@ -34,7 +34,7 @@ try {
|
||||
// Beam width used in the CTC decoder when building candidate transcriptions
|
||||
const BEAM_WIDTH = 500
|
||||
// The alpha hyperparameter of the CTC decoder. Language Model weight
|
||||
const LM_WEIGHT = 1.50
|
||||
const LM_ALPHA = 0.75
|
||||
// The beta hyperparameter of the CTC decoder. Word insertion weight (penalty)
|
||||
// const WORD_COUNT_WEIGHT = 1.00;
|
||||
/**
|
||||
@ -42,7 +42,7 @@ const LM_WEIGHT = 1.50
|
||||
* This is used to lessen the word insertion penalty
|
||||
* When the inserted word is part of the vocabulary
|
||||
*/
|
||||
const VALID_WORD_COUNT_WEIGHT = 2.10
|
||||
const LM_BETA = 1.85
|
||||
|
||||
/**
|
||||
* These constants are tied to the shape of the graph used (changing them changes
|
||||
@ -115,7 +115,7 @@ parser.init = (args) => {
|
||||
/* istanbul ignore if */
|
||||
if (process.env.LEON_NODE_ENV !== 'testing') {
|
||||
model.enableDecoderWithLM(args.alphabet, args.lm, args.trie,
|
||||
LM_WEIGHT, VALID_WORD_COUNT_WEIGHT)
|
||||
LM_ALPHA, LM_BETA)
|
||||
}
|
||||
|
||||
log.success('Language model loaded')
|
||||
|
Loading…
Reference in New Issue
Block a user