Skip to content

Commit

Permalink
Merged KWS branch into trunk
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh:https://svn.code.sf.net/p/cmusphinx/code/trunk/pocketsphinx@12145 94700074-3cef-4d97-a70e-9c8c206c02f5
  • Loading branch information
nshmyrev committed Jan 3, 2014
1 parent b8cba67 commit f562f93
Show file tree
Hide file tree
Showing 18 changed files with 954 additions and 14 deletions.
24 changes: 20 additions & 4 deletions include/cmdln_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@
#define POCKETSPHINX_OPTIONS \
waveform_to_cepstral_command_line_macro(), \
cepstral_to_feature_command_line_macro(), \
POCKETSPHINX_ACMOD_OPTIONS, \
POCKETSPHINX_ACMOD_OPTIONS, \
POCKETSPHINX_BEAM_OPTIONS, \
POCKETSPHINX_SEARCH_OPTIONS, \
POCKETSPHINX_DICT_OPTIONS, \
POCKETSPHINX_NGRAM_OPTIONS, \
POCKETSPHINX_FSG_OPTIONS, \
POCKETSPHINX_DICT_OPTIONS, \
POCKETSPHINX_NGRAM_OPTIONS, \
POCKETSPHINX_FSG_OPTIONS, \
POCKETSPHINX_KWS_OPTIONS, \
POCKETSPHINX_DEBUG_OPTIONS

/** Options for debugging and logging. */
Expand Down Expand Up @@ -173,6 +174,21 @@
"25", \
"Window of frames in lattice to search for successor words in fwdflat search " }

/** Command-line options for keyword spotting */
#define POCKETSPHINX_KWS_OPTIONS \
{ "-kws", \
ARG_STRING, \
NULL, \
"Keyphrase to spot"}, \
{ "-kws_plp", \
ARG_FLOAT64, \
"1e-1", \
"Phone loop probability for keyword spotting" }, \
{ "-kws_threshold", \
ARG_FLOAT64, \
"1", \
"Threshold for p(hyp)/p(alternatives) ratio" }

/** Command-line options for finite state grammars. */
#define POCKETSPHINX_FSG_OPTIONS \
{ "-fsg", \
Expand Down
25 changes: 24 additions & 1 deletion include/pocketsphinx.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ extern "C" {

#define PS_DEFAULT_SEARCH "default"

#define PS_SEARCH_KWS "kws"
#define PS_SEARCH_FSG "fsg"
#define PS_SEARCH_NGRAM "ngram"

Expand Down Expand Up @@ -219,7 +220,7 @@ ps_mllr_t *ps_update_mllr(ps_decoder_t *ps, ps_mllr_t *mllr);
* Actives search with the provided name.
*
* Activates search with the provided name. The search must be added before
* using either ps_set_fsg() or ps_set_lm().
* using either ps_set_fsg(), ps_set_lm() or ps_set_kws().
*
* @see ps_set_fsg
* @see ps_set_fsg
Expand Down Expand Up @@ -275,6 +276,28 @@ ps_get_fsg(ps_decoder_t *ps, const char *name);
POCKETSPHINX_EXPORT int
ps_set_fsg(ps_decoder_t *ps, const char *name, fsg_model_t *fsg);

/**
* Get the current Key phrase to spot
*
* If KWS is not enabled, this returns NULL. Call
* ps_update_kws() to enable it.
*
* @return The current keyphrase to spot
*/
POCKETSPHINX_EXPORT const char*
ps_get_kws(ps_decoder_t *ps, const char *name);

/**
* Adds new keyword to spot
*
* Associates KWS search with the provided name. The search can be activated
* using ps_set_search().
*
* @see ps_set_search
*/
POCKETSPHINX_EXPORT int
ps_set_kws(ps_decoder_t *ps, const char *name, const char *keyphrase);

/**
* Reload the pronunciation dictionary from a file.
*
Expand Down
10 changes: 8 additions & 2 deletions pocketsphinx.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pocketsphinx", "win32\pocketsphinx\pocketsphinx.vcxproj", "{94001A0E-A837-445C-8004-F918F10D0226}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pocketsphinx_continuous", "win32\pocketsphinx_continuous\pocketsphinx_continuous.vcxproj", "{1380AF76-C926-44D0-8002-06C228AC869A}"
Expand All @@ -9,6 +9,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pocketsphinx_batch", "win32
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pocketsphinx_mdef_convert", "win32\pocketsphinx_mdef_convert\pocketsphinx_mdef_convert.vcxproj", "{AB08A7C9-D327-412E-AB38-1941949F5BE6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pocketsphinx_kws", "win32\pocketsphinx_kws\pocketsphinx_kws.vcxproj", "{AEAB0D37-783D-4189-A3D2-D665764C8633}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand All @@ -31,6 +33,10 @@ Global
{AB08A7C9-D327-412E-AB38-1941949F5BE6}.Debug|Win32.Build.0 = Debug|Win32
{AB08A7C9-D327-412E-AB38-1941949F5BE6}.Release|Win32.ActiveCfg = Release|Win32
{AB08A7C9-D327-412E-AB38-1941949F5BE6}.Release|Win32.Build.0 = Release|Win32
{AEAB0D37-783D-4189-A3D2-D665764C8633}.Debug|Win32.ActiveCfg = Debug|Win32
{AEAB0D37-783D-4189-A3D2-D665764C8633}.Debug|Win32.Build.0 = Debug|Win32
{AEAB0D37-783D-4189-A3D2-D665764C8633}.Release|Win32.ActiveCfg = Release|Win32
{AEAB0D37-783D-4189-A3D2-D665764C8633}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 2 additions & 0 deletions src/libpocketsphinx/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ libpocketsphinx_la_SOURCES = \
fsg_history.c \
fsg_lextree.c \
fsg_search.c \
kws_search.c \
hmm.c \
mdef.c \
ms_gauden.c \
Expand Down Expand Up @@ -43,6 +44,7 @@ noinst_HEADERS = \
fsg_history.h \
fsg_lextree.h \
fsg_search_internal.h \
kws_search.h \
hmm.h \
mdef.h \
ms_gauden.h \
Expand Down
Loading

0 comments on commit f562f93

Please sign in to comment.