Test Skript

[FeatureSet fs] setDesc   @/home/islpra0/IslData/featDesc
                  fs  setAccess @/home/islpra0/IslData/featAccess
[CodebookSet cbs fs] read ../step8/codebookSet
[DistribSet dss cbs] read ../step2/distribSet
[PhonesSet ps] read ../step2/phonesSet
[Tags tags] read ../step2/tags
[Tree dst ps:PHONES ps tags dss] read ../step2/distribTree

SenoneSet sns [DistribStream str dss dst] -phones ps:PHONES -tags tags

[TmSet tms] read ../step2/transitionModels
[TopoSet tps sns tms] read ../step2/topologies
[Tree tpt ps:PHONES ps tags tps] read ../step2/topologyTree

fs FMatrix LDAMatrix
fs:LDAMatrix.data bload ../step5/ldaMatrix

cbs load ../step3/codebookWeights

[DBase db] open ../step1/db.dat ../step1/db.idx -mode r

[Dictionary diction ps:PHONES tags] read ../step4/convertedDict

HMM hmm diction [AModelSet amo tpt ROOT]

Path path

 

cbs load ../step8/codebookWeights
dss load ../step8/distribWeights

tpt configure -padPhone @
dst configure -padPhone @

sns setscoreFct base

PHMMSet phmms tpt [tpt.item(0) configure -name]
LCMSet lcms phmms
RCMSet rcms phmms

SVocab voc diction
[LingKS lm NGramLM] load ../step7/langmod
SVMap svmap voc lm

voc read ../step1/vocab
svmap map base
voc:\$   configure -fTag 1
voc:SIL configure -fTag 1

svmap configure -unkString +UNINTELLIGIBLE+

svmap configure -lz 16 -wordPen -0 -filPen 0

STree stree svmap lcms rcms
LTree ltree stree
SPass spass stree ltree

spass configure -morphBeam 30 -stateBeam 50 -wordBeam 35

proc recogRate { corr hypo } {

  # filter hypo
  regsub -all {\\(} \$hypo "" hypo
  regsub -all {\\)} \$hypo "" hypo
  regsub -all " SIL " \$hypo " " hypo
  regsub -all {\\+[^ ]*} \$hypo "" hypo
  regsub -all {(\\\$|\\{|\\})} \$hypo "" hypo
  regsub -all " [ ]+" \$hypo " " hypo  
  set hypo [string trim \$hypo]


  # filter ref
  regsub -all {\\(} \$corr "" corr
  regsub -all {\\)} \$corr "" corr
  regsub -all " SIL " \$corr "" corr
  regsub -all {\\+[^ ]*} \$corr "" corr
  regsub -all {(\\\$|\\{|\\})} \$corr "" corr
  regsub -all " [ ]+" \$corr " " corr
  set corr [string trim \$corr]
 

  puts "filtered hypo: \$hypo"
  puts "filtered ref : \$corr"

  set ali [align \$corr \$hypo]
  set total [llength [lindex \$ali 0]]
  set fehl  [expr [llength [lindex \$ali 2]] + [llength [lindex \$ali 3]] + [llength [lindex \$ali 4]]]
  return [expr 100.0 * (1.0 - \${fehl}.0 / \${total}.0)]
}

proc testOne { utt } {
  set uttinfo [db get \$utt]
  makeArray infoArray \$uttinfo
  fs eval \$uttinfo
  spass run
  set hypo [spass.stab trace]
 
  puts "\$utt: \$hypo"

  set hypo [lrange \$hypo 2 end]
  puts "recogRate: [recogRate \$infoArray(TEXT) \$hypo]\n"
}

set fp [open ../step1/testIDs r]

while { [gets \$fp utt] != -1 } {
  puts "testing utterance \$utt"
  testOne \$utt
}

exit