#include "pc_libs/pc_general.h"
#include "rr_libs/general.h"
#include "ngram.h"
#include "toolkit.h"
Go to the source code of this file.
Compounds | |
struct | arpa_lm_t |
Type specification for ARPA LM type. More... | |
struct | fb_info |
Type specification for forced back-off list. More... | |
Typedefs | |
typedef float | bo_t |
typedef float | prob_t |
Functions | |
unsigned short | num_of_types (int k, int ind, ng_t *ng) |
void | decode_bo_case (int bo_case, int context_length, FILE *annotation_fp) |
void | display_stats (ng_t *ng) |
void | display_arpa_stats (arpa_lm_t *arpa_ng) |
void | load_lm (ng_t *ng, char *lm_filename) |
void | load_arpa_lm (arpa_lm_t *arpa_lm, char *lm_filename) |
void | parse_comline (char *input_line, int *num_of_args, char **args) |
void | compute_perplexity (ng_t *ng, arpa_lm_t *arpa_ng, char *text_stream_filename, char *probs_stream_filename, char *annotation_filename, char *oov_filename, char *fb_list_filename, flag backoff_from_unk_inc, flag backoff_from_unk_exc, flag backoff_from_ccs_inc, flag backoff_from_ccs_exc, flag arpa_lm, flag include_unks, double log_base) |
fb_info * | gen_fb_list (sih_t *vocab_ht, int vocab_size, char **vocab, flag *context_cue, flag backoff_from_unk_inc, flag backoff_from_unk_exc, flag backoff_from_ccs_inc, flag backoff_from_ccs_exc, char *fb_list_filename) |
void | validate (ng_t *ng, arpa_lm_t *arpa_ng, char **words, flag backoff_from_unk_inc, flag backoff_from_unk_exc, flag backoff_from_ccs_inc, flag backoff_from_ccs_exc, flag arpa_lm, char *fb_list_filename) |
double | calc_prob_of (id__t sought_word, id__t *context, int context_length, ng_t *ng, arpa_lm_t *arpa_ng, fb_info *fb_list, int *bo_case, int *actual_context_length, flag arpa_lm) |
void | arpa_bo_ng_prob (int context_length, id__t *sought_ngram, arpa_lm_t *arpa_ng, int verbosity, double *p_prob, int *bo_case) |
Definition in file evallm.h.
|
Definition at line 44 of file evallm.h. Referenced by load_arpa_lm(). |
|
Definition at line 45 of file evallm.h. Referenced by load_arpa_lm(). |
|
Definition at line 25 of file arpa_bo_ng_prob.c. References arpa_lm_t::bo_weight, flag, fprintf(), free(), get_full_index(), i, arpa_lm_t::ind, arpa_lm_t::num_kgrams, arpa_lm_t::probs, arpa_lm_t::ptr_table, arpa_lm_t::ptr_table_size, rr_malloc(), verbosity, arpa_lm_t::vocab_size, and arpa_lm_t::word_id. Referenced by calc_prob_of(). |
|
Definition at line 29 of file calc_prob_of.c. References arpa_bo_ng_prob(), bo_ng_prob(), CLOSED_VOCAB, flag, free(), i, quit(), rr_malloc(), ng_t::vocab_type, and arpa_lm_t::vocab_type. Referenced by compute_perplexity(), and validate(). |
|
Definition at line 28 of file perplexity.c. References calc_prob_of(), CLOSED_VOCAB, arpa_lm_t::context_cue, ng_t::context_cue, decode_bo_case(), flag, fprintf(), free(), gen_fb_list(), i, arpa_lm_t::n, ng_t::n, quit(), rr_calloc(), rr_feof(), rr_fexists(), rr_iclose(), rr_iopen(), rr_malloc(), rr_oclose(), rr_oopen(), sih_lookup(), arpa_lm_t::vocab, ng_t::vocab, arpa_lm_t::vocab_ht, ng_t::vocab_ht, arpa_lm_t::vocab_size, ng_t::vocab_size, arpa_lm_t::vocab_type, and ng_t::vocab_type. Referenced by main(). |
|
Definition at line 28 of file decode_bo_case.c. Referenced by compute_perplexity(). |
|
Display statistics of an ARPA n-gram Definition at line 122 of file stats.c. References CLOSED_VOCAB, arpa_lm_t::context_cue, arpa_lm_t::first_id, fprintf(), i, arpa_lm_t::n, arpa_lm_t::no_of_ccs, arpa_lm_t::num_kgrams, OPEN_VOCAB_1, OPEN_VOCAB_2, arpa_lm_t::vocab, arpa_lm_t::vocab_size, and arpa_lm_t::vocab_type. Referenced by main(). |
|
Display statistics of an n-gram Definition at line 27 of file stats.c. References ng_t::abs_disc_const, ABSOLUTE, CLOSED_VOCAB, ng_t::context_cue, ng_t::disc_range, ng_t::discounting_method, ng_t::first_id, ng_t::fof_size, ng_t::four_byte_alphas, fprintf(), ng_t::freq_of_freq, GOOD_TURING, ng_t::gt_disc_ratio, i, j, ng_t::lin_disc_ratio, LINEAR, ng_t::n, ng_t::no_of_ccs, ng_t::num_kgrams, ng_t::oov_fraction, OPEN_VOCAB_1, OPEN_VOCAB_2, ng_t::vocab, ng_t::vocab_size, ng_t::vocab_type, and WITTEN_BELL. Referenced by main(). |
|
Definition at line 31 of file gen_fb_list.c. References fb_info::backed_off, flag, fprintf(), i, fb_info::inclusive, rr_calloc(), rr_iclose(), rr_iopen(), and sih_lookup(). Referenced by compute_perplexity(), and validate(). |
|
Read an ARPA LM file from a text format ARPA LM file Definition at line 316 of file load_lm.c. References bo_t, arpa_lm_t::bo_weight, CLOSED_VOCAB, arpa_lm_t::first_id, flag, fprintf(), free(), get_full_index(), i, arpa_lm_t::ind, index__t, j, arpa_lm_t::n, new_index(), arpa_lm_t::num_kgrams, OPEN_VOCAB_1, prob_t, arpa_lm_t::probs, arpa_lm_t::ptr_table, arpa_lm_t::ptr_table_size, quit(), rr_calloc(), rr_feof(), rr_iclose(), rr_iopen(), rr_malloc(), salloc(), sih_add(), sih_create(), sih_lookup(), arpa_lm_t::table_sizes, arpa_lm_t::vocab, arpa_lm_t::vocab_ht, arpa_lm_t::vocab_size, arpa_lm_t::vocab_type, and arpa_lm_t::word_id. Referenced by main(). |
|
|
Definition at line 23 of file num_of_types.c. |
|
Definition at line 31 of file parse_comline.c. References salloc(). Referenced by main(). |
|
Definition at line 26 of file validate.c. References calc_prob_of(), CLOSED_VOCAB, arpa_lm_t::context_cue, ng_t::context_cue, arpa_lm_t::first_id, ng_t::first_id, flag, fprintf(), free(), gen_fb_list(), i, arpa_lm_t::n, ng_t::n, quit(), rr_malloc(), sih_lookup(), arpa_lm_t::vocab, ng_t::vocab, arpa_lm_t::vocab_ht, ng_t::vocab_ht, arpa_lm_t::vocab_size, ng_t::vocab_size, arpa_lm_t::vocab_type, and ng_t::vocab_type. Referenced by main(). |