linto-ai / linto-stt

An automatic speech recognition API
GNU Affero General Public License v3.0
38 stars 14 forks source link

LinTO Doc #9

Closed damienlaine closed 3 years ago

damienlaine commented 4 years ago

https://doc.linto.ai/#/

Description

damienlaine commented 4 years ago

Comments are now opened ! Feel free to chat and contribute.

tagny commented 3 years ago

Hi. I've tried to download the pre-built image from docker-hub using this command in Ubuntu 20.04 LTS:

sudo docker pull lintoai/linto-platform-stt-standalone-worker:latest

I runned it using the command:

sudo docker run -p 8888:8888 -v /home/me/linto_shared/AM_fr-FR:/opt/models/AM -v /home/me/linto_shared/DG_fr-FR_Small:/opt/models/LM -v /home/me/linto_shared/swagger.yml:/opt/swagger.yml lintoai/linto-platform-stt-standalone-worker:latest

and here is the result:

INFO:__stt-standelone-worker__:Create the new config files
INFO:__stt-standelone-worker__:Create word_boundary.int based on phones.txt
INFO:__stt-standelone-worker__:Load acoustic model and decoding graph
LOG (VoskAPI:Configure():vosk/model.cc:134) Loading decode config file from /opt/config/online.conf
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done.
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:159) Am model file /opt/models/AM/.//final.mdl
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 1 orphan nodes.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 2 orphan components.
LOG (VoskAPI:Collapse():nnet-utils.cc:1488) Added 1 components, removed 2
LOG (VoskAPI:CompileLooped():nnet-compile-looped.cc:345) Spent 0.022691 seconds in looped compilation.
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:176) Loading HCLG from /opt/models/LM/HCLG.fst
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:196) Loading words from /opt/models/LM/words.txt
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:205) Loading winfo /opt/models/LM/word_boundary.int
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:260) Ivector silence weighting is deactivated

but trying http://localhost:8888/ in my browser says :

La connexion a été réinitialisée

La connexion avec le serveur a été réinitialisée pendant le chargement de la page.

    Le site est peut-être temporairement indisponible ou surchargé. Réessayez plus tard ;
    Si vous n’arrivez à naviguer sur aucun site, vérifiez la connexion au réseau de votre ordinateur ;
    Si votre ordinateur ou votre réseau est protégé par un pare-feu ou un proxy, assurez-vous que Firefox est autorisé à accéder au Web.

Please can anyone tell me why it doesn't work ?

damienlaine commented 3 years ago

@irebai would you help with this ?

irebai commented 3 years ago

Hi @tagny since you started the service using "docker run" instead of "docker-compose up", so you need to start also the swagger service in order to have access to the swagger documentation page through "http://localhost:8888/". Please, take a look at the docker-compose.yml file to know how to run the service.

tagny commented 3 years ago

Hi @irebai Thanks for your reply. I did run the swagger service now after converting the swagger.yml into a JSON file (https://github.com/linto-ai/linto-platform-stt-standalone-worker/blob/master/document/swagger.yml) :

sudo docker run -p 80:8080 -e BASE_URL=/swagger -e SWAGGER_JSON=/foo/swagger.json -v /home/me/linto_shared:/foo swaggerapi/swagger-ui 

I was able to access the api doc web page at http://localhost/swagger :

LinSTT 1.0.0 

[ Base URL: localhost:8888/ ]

./swagger.json

A simple way to test LinSTT API, and to learn how to use API
...

but the running STT standalone worker is still not working.

Is it not possible to transcribe without launching swagger ?

Am I missing something here ?

I tried the curl command (https://github.com/linto-ai/linto-platform-stt-standalone-worker/blob/master/test/test_deployment.sh), and I got this response:

$ curl -X POST "http://localhost:8888/transcribe" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@bonjour.wav;type=audio/wav"

curl: (56) Recv failure: Connexion ré-initialisée par le correspondant

Please it will be very helpful if you give me the detail procedure with all the commands to make the STT standalone worker work.

I will be very grateful.

damienlaine commented 3 years ago

Hello @tagny i assigned @irebai and moved the issue in the correct project.

irebai commented 3 years ago

Hi @tagny, did you run the curl command in the test folder since this command use the file "@bonjour.wav" that is in this folder ? could you, after executing this command, print the worker service logs to see what is going on exactly please.

tagny commented 3 years ago

Hi @tagny, did you run the curl command in the test folder since this command use the file "@bonjour.wav" that is in this folder ? could you, after executing this command, print the worker service logs to see what is going on exactly please.

Hi @irebai Yes I did run the the exact curl command that is in the test_deployment.sh script from the test folder of this repository that contains the file "bonjour.wav". Nothing more is added to this log as if the request never reached the service:

INFO:__stt-standelone-worker__:Create the new config files
INFO:__stt-standelone-worker__:Create word_boundary.int based on phones.txt
INFO:__stt-standelone-worker__:Load acoustic model and decoding graph
LOG (VoskAPI:Configure():vosk/model.cc:134) Loading decode config file from /opt/config/online.conf
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done.
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:159) Am model file /opt/models/AM/.//final.mdl
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 1 orphan nodes.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 2 orphan components.
LOG (VoskAPI:Collapse():nnet-utils.cc:1488) Added 1 components, removed 2
LOG (VoskAPI:CompileLooped():nnet-compile-looped.cc:345) Spent 0.022691 seconds in looped compilation.
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:176) Loading HCLG from /opt/models/LM/HCLG.fst
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:196) Loading words from /opt/models/LM/words.txt
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:205) Loading winfo /opt/models/LM/word_boundary.int
LOG (VoskAPI:ReadDataFiles():vosk/model.cc:260) Ivector silence weighting is deactivated
irebai commented 3 years ago

Hi @tagny, In fact, you lunched the worker service with ports 8888:8888. However, the worker is running on port 80 (target port in docker-compose.yml and the default value in tools.py). So, you need either changer the port when you run the docker (8888:80) or specify the worker's port to run on (-e SERVICE_PORT=8888). I recommend you to use docker-compse up to run the service and .env file to specify the worker paramerters.

tagny commented 3 years ago

Great! It works just fine after :

Here is the result I got after running the request cd test; ./test_deployment.sh:

{"confidence-score":1.0,"speakers":[{"end":0.78,"speaker_id":"spk1","start":0.0,"words":[{"conf":1.0,"end":0.78,"start":0.0,"word":"bonjour"}]}],"text":["spk1 : bonjour"]}

Even swagger works well at http://localhost:8888/api-doc.

Than you very much @irebai.

I will now try the bigger language models for French and English (https://dl.linto.ai/downloads/model-distribution/acoustic-models/, https://dl.linto.ai/downloads/model-distribution/decoding-graphs/LVCSR), and the streaming STT standalone worker.

irebai commented 3 years ago

It's great to hear that ! Enjoy using our models and services :) For any questions or recommendations, please contact me at: irebai@linagora.com (or rebai_ilyes@hotmail.fr)