Phonetisaurus  1.0
FST-based Grapheme-to-Phoneme conversion
Typedefs | Functions
phonetisaurus-g2prnn.cc File Reference
#include <fst/fstlib.h>
#include <include/LegacyRnnLMHash.h>
#include <include/LegacyRnnLMDecodable.h>
#include <include/LegacyRnnLMReader.h>
#include <include/RnnLMDecoder.h>
#include <include/util.h>
#include "utf8.h"

Go to the source code of this file.

Typedefs

typedef LegacyRnnLMDecodable< Token, LegacyRnnLMHashDecodable
 
typedef unordered_map< int, SimpleResultRMAP
 

Functions

void ThreadedEvaluateWordlist (vector< string > &corpus, RMAP &rmap, LegacyRnnLMHash &h, Decodable &s, int FLAGS_threads, int FLAGS_beam, int FLAGS_kmax, int FLAGS_nbest, bool FLAGS_reverse, string FLAGS_gpdelim, string FLAGS_gdelim, string FLAGS_skip, double FLAGS_thresh, string FLAGS_gsep)
 
void EvaluateWordlist (vector< string > &corpus, LegacyRnnLMHash &h, Decodable &s, int FLAGS_beam, int FLAGS_kmax, int FLAGS_nbest, bool FLAGS_reverse, string FLAGS_gpdelim, string FLAGS_gdelim, string FLAGS_skip, double FLAGS_thresh, string FLAGS_gsep)
 
void EvaluateWord (string word, LegacyRnnLMHash &h, Decodable &s, int FLAGS_beam, int FLAGS_kmax, int FLAGS_nbest, bool FLAGS_reverse, string FLAGS_gpdelim, string FLAGS_gdelim, string FLAGS_skip, double FLAGS_thresh, string FLAGS_gsep)
 
 DEFINE_string (rnnlm,"","The input RnnLM model.")
 
 DEFINE_string (wordlist,"","Input word list to evaluate.")
 
 DEFINE_string (word,"","Single input word to evaluate.")
 
 DEFINE_string (gdelim,"|","The default multigram delimiter.")
 
 DEFINE_string (gpdelim,"}","The default grapheme / phoneme delimiter.")
 
 DEFINE_string (gsep,"","The default grapheme delimiter for testing. Typically ''.")
 
 DEFINE_string (skip,"_","The default null/skip token.")
 
 DEFINE_int32 (nbest, 1,"Maximum number of hypotheses to return.")
 
 DEFINE_int32 (threads, 1,"Number of parallel threads (OpenMP).")
 
 DEFINE_int32 (kmax, 20,"State-local maximum queue size.")
 
 DEFINE_int32 (beam, 20,"The state-local beam width.")
 
 DEFINE_double (thresh, 0.0,"The n-best pruning threshold. Relative to 1-best.")
 
 DEFINE_bool (reverse, false,"Reverse the input word before decoding.")
 
int main (int argc, char *argv[])
 

Typedef Documentation

Definition at line 13 of file phonetisaurus-g2prnn.cc.

typedef unordered_map<int, SimpleResult> RMAP

Definition at line 14 of file phonetisaurus-g2prnn.cc.

Function Documentation

DEFINE_bool ( reverse  ,
false  ,
"Reverse the input word before decoding."   
)
DEFINE_double ( thresh  ,
0.  0,
"The n-best pruning threshold. Relative to 1-best."   
)
DEFINE_int32 ( nbest  ,
,
"Maximum number of hypotheses to return."   
)
DEFINE_int32 ( threads  ,
,
"Number of parallel threads (OpenMP)."   
)
DEFINE_int32 ( kmax  ,
20  ,
"State-local maximum queue size."   
)
DEFINE_int32 ( beam  ,
20  ,
"The state-local beam width."   
)
DEFINE_string ( rnnlm  ,
""  ,
"The input RnnLM model."   
)
DEFINE_string ( wordlist  ,
""  ,
"Input word list to evaluate."   
)
DEFINE_string ( word  ,
""  ,
"Single input word to evaluate."   
)
DEFINE_string ( gdelim  ,
"|"  ,
"The default multigram delimiter."   
)
DEFINE_string ( gpdelim  ,
"}"  ,
"The default grapheme / phoneme delimiter."   
)
DEFINE_string ( gsep  ,
""  ,
"The default grapheme delimiter for testing. Typically ''."   
)
DEFINE_string ( skip  ,
"_"  ,
"The default null/skip token."   
)
void EvaluateWord ( string  word,
LegacyRnnLMHash h,
Decodable s,
int  FLAGS_beam,
int  FLAGS_kmax,
int  FLAGS_nbest,
bool  FLAGS_reverse,
string  FLAGS_gpdelim,
string  FLAGS_gdelim,
string  FLAGS_skip,
double  FLAGS_thresh,
string  FLAGS_gsep 
)

Definition at line 84 of file phonetisaurus-g2prnn.cc.

void EvaluateWordlist ( vector< string > &  corpus,
LegacyRnnLMHash h,
Decodable s,
int  FLAGS_beam,
int  FLAGS_kmax,
int  FLAGS_nbest,
bool  FLAGS_reverse,
string  FLAGS_gpdelim,
string  FLAGS_gdelim,
string  FLAGS_skip,
double  FLAGS_thresh,
string  FLAGS_gsep 
)

Definition at line 57 of file phonetisaurus-g2prnn.cc.

int main ( int  argc,
char *  argv[] 
)

Definition at line 121 of file phonetisaurus-g2prnn.cc.

void ThreadedEvaluateWordlist ( vector< string > &  corpus,
RMAP rmap,
LegacyRnnLMHash h,
Decodable s,
int  FLAGS_threads,
int  FLAGS_beam,
int  FLAGS_kmax,
int  FLAGS_nbest,
bool  FLAGS_reverse,
string  FLAGS_gpdelim,
string  FLAGS_gdelim,
string  FLAGS_skip,
double  FLAGS_thresh,
string  FLAGS_gsep 
)

Definition at line 17 of file phonetisaurus-g2prnn.cc.