confidence.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 #ifndef __CONFIDENCE_H__
00059 #define __CONFIDENCE_H__
00060
00061
00062 #include <stdio.h>
00063
00064 #include <logmath.h>
00065 #include "dict.h"
00066 #include "lm.h"
00067 #include "fillpen.h"
00068 #include "s3types.h"
00069 #include "search.h"
00070
00071 #define CONFIDENCE_MAX_INT 2147483640
00072 #define CONFIDENCE_MIN_INT -2147483640
00073 #define CONFIDENCE_FAILURE 0
00074 #define CONFIDENCE_SUCCESS 1
00075 #define MAGIC_CONFIDENCE_CONSTANT 39.5
00076 #define MIN_LOG -690810000
00077
00078
00079 #ifdef __cplusplus
00080 extern "C" {
00081 #endif
00082 #if 0
00083
00084 }
00085 #endif
00086
00092 typedef struct ca_dagnode_type {
00093 char word[64];
00094 int wid;
00095 int seqid;
00096 int sf;
00097 int fef;
00098 int lef;
00099 int reachable;
00100 int visited;
00101 int fanin;
00102 int fanout;
00103 int hscore;
00104 int pscore;
00105 int lscore;
00106 int cscore;
00107 struct ca_daglink_type *succlist;
00108 struct ca_daglink_type *predlist;
00109 struct ca_dagnode_type *alloc_next;
00110 } ca_dagnode;
00111
00112 typedef struct ca_daglink_type {
00113 ca_dagnode *from;
00114 ca_dagnode *to;
00115 int ascore;
00116 int alpha_beta;
00118 struct ca_daglink_type *next;
00119 } ca_daglink;
00120
00121 typedef struct ca_dag_type {
00122 ca_dagnode *nodelist;
00123 ca_dagnode **seqidtonode;
00124 ca_daglink entry;
00125 ca_daglink exit;
00126 int nfrm;
00127 int nnode;
00128 int nedge;
00129 logmath_t *logmath;
00130 } ca_dag;
00131
00132
00137 S3DECODER_EXPORT
00138 int32 confidence_word_posterior(char* dagfile,
00139 seg_hyp_line_t *seg_hyp_line,
00140 char* uttid,
00141 lm_t *lm,
00142 dict_t *dict,
00143 fillpen_t *fpen
00144 );
00145
00146
00147 #if 0
00148
00151 int ca_dag_load_lattice(char *filename,
00152 ca_dag *word_lattice,
00153 lm_t *lm,
00154 dict_t *dict,
00155 fillpen_t* fillpen
00156 );
00157
00161 int alpha_beta(ca_dag *word_lattice,
00162 lm_t* lm,
00163 dict_t* dict
00164 );
00165
00166
00167
00168
00169
00170
00171 int pwp(seg_hyp_line_t *seg_hyp_line,
00172 ca_dag *word_lattice
00173 );
00174
00178 int ca_dag_free_lattice(ca_dag *word_lattice);
00179
00180 #endif
00181
00185 S3DECODER_EXPORT
00186 int compute_lmtype(seg_hyp_line_t *seg_hyp_line,
00187 lm_t* lm,
00188 dict_t* dict
00189 );
00190
00191 S3DECODER_EXPORT
00192 int compute_combined_lmtype(seg_hyp_line_t *seg_hyp_line);
00193
00194 #ifdef __cplusplus
00195 }
00196 #endif
00197
00198
00199 #endif
00200