classifier.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 
3 #ifndef __SPHINX3_CLASSIFIER_H
4 #define __SPHINX3_CLASSIFIER_H
5 
6 #include "s3types.h"
7 #include "cont_mgau.h"
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 #if 0
13 } /* Fool Emacs into not indenting things. */
14 #endif
15 
16 #define CEP_LEN 13
17 #define VOTING_LEN 5
18 #define CLASS_LATENCY 2
19 #define CLASS_SILENCE_PRIOR 0.4f
20 #define CLASS_OWNER_PRIOR 0.4f
21 #define CLASS_SECONDARY_PRIOR 0.1f
22 #define CLASS_NOISE_PRIOR 0.1f
23 
24 
25 enum {
31 };
32 
33 enum {
34  EP_MAYBE = 0,
37 };
38 
39 typedef struct {
41  s3cipid_t class_map[NUM_CLASSES];
42  int32 frame_prob[NUM_CLASSES];
46  int voting_frames[VOTING_LEN];
48  int32 prior_prob[NUM_CLASSES] ;
49 
50 } classifier_t;
51 
52 typedef struct {
53  int *endpts;
56  int state;
60  int counter;
61 
65 } endptr_t;
66 
67 int cl_init(classifier_t *_cl, char *_mdef_file, char *_means_file, char *_vars_file,
68  float64 _var_floor, char *_mix_weights_file,
69  float64 _mix_weight_floor, char *_gm_type, int _post_classify);
70 void cl_finish(classifier_t *_cl);
71 void cl_calc_frame_prob(classifier_t *_cl, float32 *_frame);
72 int cl_classify_frames(classifier_t *_cl, float32 **_frames, int _num_frames,
73  int **_classes);
74 
75 void ep_init(endptr_t *_ep, int _pad_leader, int _pad_trailer,
76  int _pad_cancel);
77 void ep_finish(endptr_t *_ep);
78 int ep_endpoint(endptr_t *_ep, int *_classes, int _num_frames,
79  int **_endpts);
80 
81 #if 0
82 { /* Stop indent from complaining */
83 #endif
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif
int ep_endpoint(endptr_t *_ep, int *_classes, int _num_frames, int **_endpts)
Definition: classifier.h:29
void ep_finish(endptr_t *_ep)
Definition: classifier.h:52
int * cached_classes
Definition: classifier.h:43
int state
Definition: classifier.h:56
int counter
Definition: classifier.h:60
int post_classify
Definition: classifier.h:47
Definition: classifier.h:35
int start_counter
Definition: classifier.h:57
Interface of full GMM computation with integer value of log likelihood.
#define VOTING_LEN
Definition: classifier.h:17
int max_endpts
Definition: classifier.h:55
void cl_calc_frame_prob(classifier_t *_cl, float32 *_frame)
int end_counter
Definition: classifier.h:59
Definition: classifier.h:27
int pad_trailer
Definition: classifier.h:64
int * endpts
Definition: classifier.h:53
int16 s3cipid_t
Definition: s3types.h:110
int pad_leader
Definition: classifier.h:63
Size definition of semantically units. Common for both s3 and s3.X decoder.
Definition: classifier.h:28
int cl_init(classifier_t *_cl, char *_mdef_file, char *_means_file, char *_vars_file, float64 _var_floor, char *_mix_weights_file, float64 _mix_weight_floor, char *_gm_type, int _post_classify)
Definition: classifier.h:39
int cl_classify_frames(classifier_t *_cl, float32 **_frames, int _num_frames, int **_classes)
void cl_finish(classifier_t *_cl)
The set of mixture-Gaussians in an acoustic model used in Sphinx 3.X family of tool.
Definition: cont_mgau.h:207
Definition: classifier.h:34
int max_frames
Definition: classifier.h:45
Definition: classifier.h:30
int num_frames
Definition: classifier.h:44
Definition: classifier.h:26
int num_endpts
Definition: classifier.h:54
mgau_model_t * gmm
Definition: classifier.h:40
int cancel_counter
Definition: classifier.h:58
void ep_init(endptr_t *_ep, int _pad_leader, int _pad_trailer, int _pad_cancel)
int pad_cancel
Definition: classifier.h:62
Definition: classifier.h:36