...
 
Commits (4)
......@@ -9,17 +9,7 @@ Otherwise, you can install them referring to [https://docs.docker.com/engine/ins
## Get all the docker images
### Kaldi-gstreamer
**TODO**
### Speech Enhancement
**TODO**
### Controller
**TODO**
See LinSTT-poc for all information [ReadMe.md](https://ci.linagora.com/linagora/lgs/labs/linstt-poc/blob/master/README.md)
## Clone linstt-controller
......@@ -30,10 +20,31 @@ Note that if you have an old docker image tagged `linagora/linstt-controller` on
## Environment variables
**TODO**
The configuration of the controller maybe need to be updated, depending on the names of the containers that will be deployed in docker. Check in `linstt-poc/linstt-controller/config.json` that the indicated hosts match the ones of your docker containers:
- gstreamer :
- `host : linsttpoc_kaldi_1`
- `port : 80`
- speechEnhancement :
- `host : linsttpoc_speech-enhencement_1`
- `port : 5000`
- offline :
- `host : linsttpoc_offline-server_1`
- `port : 8888`
Two decoding modes are offered in LinSTT: offline and online.
1. 'Offline' is a new decoding mode provided by a new component developed by LINAGORA. It provides better transcription success rates (average +25% success rate) at the expense of being slightly slower and computing intensive than the usual 'online' mode.
2. 'Online' is the usual decoding mode which is faster (approximatively 5 second faster per decoding task) and less CPU intensive. But it is also less robust, offering lower transcription success. This mode is provided by the Kaldi GStreamer software component that is bundled with LinSTT.
We offer the possibly to cold-switch between Offline and Online transcription modes. By default Online mode is used. You can toggle between the 2 using the following parameter in `linstt-poc/linstt-controller/config.json`:
- `isOffline` : `true` or `false` (This value will only be used if the system don't have the environment variable define in the `.env` from the linstt-poc)
## Run linstt-controller
Be sure that you are in the linstt-controller directory, and run `docker-compose up`. You can set environment variables in the same command line, as explained above.
......@@ -23,7 +23,7 @@ module.exports = config => {
const uuidv1 = require('uuid/v1');
return {
transcript: (wavFile, enhancementlCallback) => {
transcript: (wavFile, model, enhancementlCallback) => {
let port = config.port;
if (process.env.OFFLINE_PORT !== undefined) {
port = process.env.OFFLINE_PORT;
......@@ -45,7 +45,8 @@ module.exports = config => {
filename: myUuidString,
contentType: 'audio/x-wav'
}
}
},
model
},
encoding: null
};
......
......@@ -33,7 +33,7 @@ const routesFactory = config => {
const stt = require('../controller/speech-to-text')(config.gstreamer);
const offline = require('../controller/offline')(config.offline);
routes.post('/api/transcript', (req, res) => {
routes.post('/api/transcript/:model*?', (req, res) => {
if (!req.body) {
return res.status(badRequestCode).send('No files were uploaded.');
}
......@@ -41,6 +41,9 @@ const routesFactory = config => {
if (req.get('content-type') === undefined) {
return res.status(noContentTypeCode).send('No content type given');
}
if (req.params.model === undefined) {
req.params.model = 'uc1';
}
enhancer.enhancement(req.body, (err, response, body) => {
if (err) {
......@@ -50,7 +53,7 @@ const routesFactory = config => {
}
if (process.env.IS_OFFLINE === 'true' || (process.env.IS_OFFLINE === undefined && config.isOffline === true)) {
offline.transcript(body, (err, response, body) => {
offline.transcript(body, req.params.model, (err, response, body) => {
if (err) {
return res.status(interalServerCode).json({module: 'Offline transcription', error: 'Error during audio transcription', info: err.toString()});
} else if (response === undefined || body === undefined || response.statusCode !== successCode) {
......@@ -64,7 +67,6 @@ const routesFactory = config => {
const jsonStr = json.transcript.transcription;
let jsonResponse = {};
try {
const transcription = JSON.parse(json.transcript.transcription);
......