Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Announce] added a new feature "grammar search on the 1st pass" #130

Open
LeeAkinobu opened this issue Apr 29, 2020 · 1 comment
Open

[Announce] added a new feature "grammar search on the 1st pass" #130

LeeAkinobu opened this issue Apr 29, 2020 · 1 comment

Comments

@LeeAkinobu
Copy link
Member

A pull request has been merged that adds a new feature "grammar search on the 1st pass". To use it, get the latest code on master branch.

It enables applying full grammar on the 1-pass, thus outputs more reliable (grammar-constrained) result at the 1st pass.

Background

The grammar-based recognition on Julius does not apply the full grammar on the 1st pass, but applies only the word-pair constraint extracted from the grammar for efficiency. The errors on the 1st pass caused by the loose constraint will be recovered on the final pass, so the approximation basically does not impact on the final result.

However, there are cases in which the 1st pass result should be more precise, typically on a real-time application that aims to utilize the partial recognition output before audio input ends)

Effect

This update enables applying full grammar on the 1st pass. When enabled, the generated word hypotheses on the 1st pass will be examined by the grammar parser at every frame and only the words that is allowed to connect on the context will be expanded.

This feature is enabled when a recognition grammar (a set of .dfa and .dict files) has an additional dfa file (.dfa.forward). This also works on multiple grammar recognition.

No harm on old grammars, almost no impact on the recognition speed.

Usage

  • Re-run the updated grammar converter mkdfa.pl (or mkdfa.py) of the latest commit to your recognition grammar. The output (.dfa, .dict) will be the same as the previous versions, but now it generates an extra file (*.dfa.forward).
  • Run Julius with the generated grammar. It additionally reads .dfa.forward file if it exists, and enable the new feature. The (progressive) result always conforms the given grammar from the head.

Restriction

You can not yet give the .dfa.forward file when throwing a grammar via module mode. It is not implemented now.

@LeeAkinobu
Copy link
Member Author

There was some serious bug which causes segfaults with grammars without .dfa.forward file.

There was also a bug in that mkdfa.pl outputs wrong .dfa.forward when .grammar file does not end with newline.

These bugs are fixed in the recent commit (7e0cb3f and 4d2415b). Please use the latest version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant