julius-speech / julius

Open-Source Large Vocabulary Continuous Speech Recognition Engine
BSD 3-Clause "New" or "Revised" License
1.84k stars 299 forks source link

How to run julius with only text as output? #94

Open newgithubuser1234 opened 5 years ago

newgithubuser1234 commented 5 years ago

Hello. Is there a way to run julius with an option, which actually would make it print just best sentence as an output? I run julius with that command: "julius -C julius.jconf -dnnconf dnn.jconf -input mic" and what I get is

Recognition: 2nd pass (RL heuristic best-first) STAT: 00 _default: 14715 generated, 4565 pushed, 339 nodes popped in 175 ALIGN: === word alignment begin === sentence1: PTAK wseq1: PTAK phseq1: sil | p t a k | sil cmscore1: 0.683 0.072 1.000 score1: 65.000496 === begin forced alignment === -- word alignment -- id: from to confidence unit

[ 24676 24676] 0.682506 [] [ 24677 24765] 0.072064 PTAK [PTAK] [ 24766 24847] 1.000000 [] current base = 24676re-computed AM score: 142.784332 === end forced alignment ===

In this example, I wish to get just "PTAK". I need that, because I want to send sentence to other program, which is supposed to print me what I got. I don't know much about speech recognition and I am not really pro at programming stuff.

Second question is: is there a possibility to turn off Julius automatically after it sends me first sentence? I read a lot about it last days, since I couldn't find anything for polish converting speech to text on linux offline. I would really appreciate answer, which would solve my problems.

Third question: are there some options, which would convert single word without context better?

LeeAkinobu commented 5 years ago

First question: option -quiet turns off almost all output and just outputs the result. See Options document for details.

Second question: Using adintool audio front end and use -autopause option for the adintool will do the job:

Term 1:
% adintool -in mic -out adinnet -autopause
Term 2:
% julius -C ... -input adinnet

The adintool will stop just after sending the first input to Julius. Note that the paused adintool should be resumed from Julius via socket contol. Test the resume using module mode like this:

Term 1:
% adintool -in mic -out adinnet -autopause
Term 2:
% julius -C ... -input adinnet -module
Term 3:
% jclient.py
(after pause, type below and hit enter to resume audio input)
RESUME
kumar-nilesh-101 commented 5 years ago

hello, I tried running julius with -quiet as /home/zeus/gitRepoClones/julius/julius/julius -C julius.jconf -dnnconf dnn.jconf -quiet but it still prints everything. Any solutions to this

colbec commented 5 years ago

Did you investigate whether the position of the -quiet in the command is important? Normally one would expect to see global options immediately after the call to julius, that is before the -C and -dnnconf pairs?

kumar-nilesh-101 commented 5 years ago

I tried it but no improvements

AgentCoop commented 4 years ago

Well, after playing around with it for a while, it seems to me that this tool is completely useless for any particular application except for academic and research purposes.

You could at least output recognized words in an XML or JSON format for developers to be able to use it.

palles77 commented 4 years ago

I think this is quite offensive to the effort of the creator - Mr Lee. In my opinion this is the best decoder available out there. It has been used extensively in commercial environments. Just because you do not make the effort of spending time with it does not make it useless.

zdomjus60 commented 4 years ago

@LivingScripts A little contribution of mine. After having redirected the output to a text file, say "speech.txt", you can use the attached script I have written in python language to filter most of the verbose text and generate a new file, for example "extract.txt", containing only the words of your interest. Obviously, you must have python installed, then you have to copy the script to the same directory where "speech.txt" (or whatever name you have chosen) is, change the script extension from .txt to .py, inside the script modify the input and output file names at your own discretion, launch it with command python extract_words.py. It's very fast. extract_words.txt

MikeyBeez commented 4 years ago

I've switched to vosk. It works much better. https://github.com/MikeyBeez/Juliet