Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 983 Bytes

README.md

File metadata and controls

24 lines (15 loc) · 983 Bytes

JSGF to FST

This Python module takes one or more JSGF grammars and converts them to finite state transducers using OpenFST.

Optionally, ARPA language models can be created using Opengrm.

Dependencies

Requires OpenFST and the sphinx_jsgf2fsg command. These are usually found in the libfst-dev and sphinxbase-utils Debian packages. Opengrm must be installed from source.

Usage

The typical usage for jsgf2fst is:

  1. Create some JSGF grammars, one per intent
  2. Tag critical pieces of each sentence with a JSGF tag (e.g., (red | green){color})
  3. Parse the JSGF grammar(s) using pyjsgf
  4. Convert to FSTS with jsgf2fst.jsgf2fst(...)
  5. Merge into a single acceptor FST with jsgf2fst.make_intent_fst(...)
  6. Recognize intents from text with jsgf2fst.fstaccept(...)

Acknowledgements

This library depends on a modified version of pyjsgf.