[Freeswitch-svn] [commit] r8962 - freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx

Freeswitch SVN brian at freeswitch.org
Wed Jul 9 14:00:38 EDT 2008


Author: brian
Date: Wed Jul  9 14:00:38 2008
New Revision: 8962

Modified:
   freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c

Log:
tweak

Modified: freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	(original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	Wed Jul  9 14:00:38 2008
@@ -135,7 +135,7 @@
 							 "-wbeam", "1e-40",
 							 "-ci_pbeam", "1e-8",
 							 "-subvqbeam", "1e-2",
-							 "-maxhmmpf", "2000",
+							 "-maxhmmpf", "10000",
 							 "-maxcdsenpf", "1000",
 							 "-maxwpf", "8",
 							 "-ds", "2",
@@ -351,16 +351,21 @@
 	if (switch_test_flag(ps, PSFLAG_HAS_TEXT)) {
 		switch_mutex_lock(ps->flag_mutex); 
 		switch_clear_flag(ps, PSFLAG_HAS_TEXT);
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Recognized: %s, Score: 600\n", ps->hyp);
+
+		if (ps->score < 0) {
+			ps->score = 600;
+		}
+
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Recognized: %s, Score: %d\n", ps->hyp, ps->score);
 		switch_mutex_unlock(ps->flag_mutex); 
 
 		/* ps->score isn't a confidence score. PocketSphinx doesn't support that yet. */
 		
-		*xmlstr = switch_mprintf("<interpretation grammar=\"%s\" score=\"600\">\n"
+		*xmlstr = switch_mprintf("<interpretation grammar=\"%s\" score=\"%d\">\n"
 								 "  <result name=\"%s\">%s</result>\n"
 								 "  <input>%s</input>\n"
 								 "</interpretation>",
-								 ps->grammar,
+								 ps->grammar, ps->score,
  								 "match", 
 								 ps->hyp, 
 								 ps->hyp



More information about the Freeswitch-svn mailing list