Main Page
Classes
Files
File List
File Members
include
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
{
26
CLASS_NOISE
= 0,
27
CLASS_OWNER
,
28
CLASS_SECONDARY
,
29
CLASS_SILENCE
,
30
NUM_CLASSES
31
};
32
33
enum
{
34
EP_MAYBE
= 0,
35
EP_SILENCE
,
36
EP_SPEECH
37
};
38
39
typedef
struct
{
40
mgau_model_t
*
gmm
;
41
s3cipid_t
class_map[
NUM_CLASSES
];
42
int32 frame_prob[
NUM_CLASSES
];
43
int
*
cached_classes
;
44
int
num_frames
;
45
int
max_frames
;
46
int
voting_frames[
VOTING_LEN
];
47
int
post_classify
;
48
int32 prior_prob[
NUM_CLASSES
] ;
49
50
}
classifier_t
;
51
52
typedef
struct
{
53
int
*
endpts
;
54
int
num_endpts
;
55
int
max_endpts
;
56
int
state
;
57
int
start_counter
;
58
int
cancel_counter
;
59
int
end_counter
;
60
int
counter
;
61
62
int
pad_cancel
;
63
int
pad_leader
;
64
int
pad_trailer
;
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
Generated by
1.8.1.1