From 7ff6655763f05f7a3804580c2bf4c8bc3ac67b8a Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Wed, 28 Jan 2015 14:24:18 +0100 Subject: [PATCH] Added levels to recognition precission --- Config.praat | 9 +++++++-- Data/Config_DE.Table | 2 +- Data/Config_EN.Table | 2 +- Data/Config_NL.Table | 2 +- InitialiseSGC2.praat | 5 +++-- MainPage.praat | 9 +++++++-- ToneProt/SGC_ToneProt.praat | 1 - ToneProt/ToneRecognition.praat | 12 ++++++++++++ ToneProt/ToneScript.praat | 6 +++++- sgc2.praat | 5 +++++ 10 files changed, 42 insertions(+), 11 deletions(-) diff --git a/Config.praat b/Config.praat index 7c742c0..8491059 100644 --- a/Config.praat +++ b/Config.praat @@ -159,8 +159,13 @@ endproc procedure processConfigStrict .clickX .clickY .pressed$ .table$ = "Config" .label$ = "Strict" - config.strict = not config.strict - if config.strict > 0 + .tmp = 'config.strict$' + .tmp += 1 + if .tmp > sgc.highestLevel + .tmp = 0 + endif + config.strict$ = "'.tmp'" + if .tmp > 0 .displayButton = 2 else .displayButton = 0 diff --git a/Data/Config_DE.Table b/Data/Config_DE.Table index e14eb30..648e5f3 100644 --- a/Data/Config_DE.Table +++ b/Data/Config_DE.Table @@ -33,7 +33,7 @@ ShuffleLists Shuffle S Shuffle W\o"rter in Wortlisten (ein) oder eine feste Reih UseSoundExample Audio Vorbild V Gebrauche echte Aufnahmen zum Vorbild wenn anwesend (ein) oder synthetische T\o"ne (aus) Synthesis_eSpeak Synthese y Gebrauche eine synthetische Stimme zum Vorbild (Sie brauche eSpeak: www.espeak.org) $Recognition Sprachkenntnisse Einstellung f\u"r fortgeschrittene Studenten -Strict Fortgeschritten! !1 Sei preziese bei der Erkennung der T\o"ne, f\u"r fortgeschrittene Studenten. Vergleiche mit richtige Sprache wenn anwesend +Strict Stufe $$$ !1 Wie preziese die Aussprache der T\o"ne gepr\u"ft wird (Stufe 0-3). Die h\o"gste Stufe fordert eine preciese Aussprage OpenWordlist \O"fne Liste+ += W\a"hle und \o"fne eine wortliste InstallWordlist Installiere Listen r Installiere alle .sgc wortlisten in die Documents, Downloads, und Preferences Mappen DeleteWordlist L\o"ssche Liste X X L\o"ssche die Wortliste. Sie m\u"ssen die 'j' taste dr\u"cken um das L\o"sschen zu best\a"tigen. diff --git a/Data/Config_EN.Table b/Data/Config_EN.Table index e31f3c2..8cc9ca4 100644 --- a/Data/Config_EN.Table +++ b/Data/Config_EN.Table @@ -25,7 +25,7 @@ ShuffleLists Shuffle S Shuffle words in word lists (on) or use a fixed order (of UseSoundExample Real example x Use a real sound recording (on) if available or synthesized tones (off) as examples Synthesis_eSpeak Synthesis y Use a synthetic voice as example (you need eSpeak: www.espeak.org) $Recognition Proficiency Set to recognize advanced or native speakers -Strict Advanced! !1 Be very precise in pronunciation checking, for advanced students. Compare to real speech when available +Strict Level $$$ !1 How strict tone pronunciation will be checked (Level 0-3). The highest level is quite strict. OpenWordlist Open List+ += Select and read a wordlist InstallWordlist Install Lists t Install all .sgc wordlist packages found in the Documents, Downloads, and Preferences directories DeleteWordlist Delete List D Permanently delete the word list. You have to confirm this by typing 'y' diff --git a/Data/Config_NL.Table b/Data/Config_NL.Table index e042b66..15135f5 100644 --- a/Data/Config_NL.Table +++ b/Data/Config_NL.Table @@ -25,7 +25,7 @@ ShuffleLists Woorden mixen x Gebruik elke keer een andere volgorde van de woorde UseSoundExample Spraakvoorbeeld S Laat echte spraakopnamen (aan) of kunstmatige tonen (uit) horen als voorbeeld Synthesis_eSpeak Synthese y Gebruik een synthetische stem als voorbeeld (eSpeak is hiervoor nodig: www.espeak.org) $Recognition Taalniveau Stel de herkenner in op gevorderde of moedertaal sprekers -Strict Gevorderd! !1 Extra preciese uitspraakcontrolle voor gevorderde studenten. Vergelijk met echte spraak wanneer beschikbaar +Strict Niveau $$$! !1 Hoe strikt de uitspraak van de tonen gecontroleerd wordt (Niveau 0-3). Het hoogste niveau is strikt. OpenWordlist Open Lijst+ += Selecteer en lees een woordlijst InstallWordlist Installeer Lijsten I Installeer alle .sgc woordpaketten uit de Downloads, Documents en Preferences mappen DeleteWordlist Verwijder Lijst d Verwijder de getoonde woordlijst permanent, u moet dit bevestigen door een 'j' te typen diff --git a/InitialiseSGC2.praat b/InitialiseSGC2.praat index 8a8df00..a48a428 100644 --- a/InitialiseSGC2.praat +++ b/InitialiseSGC2.praat @@ -78,7 +78,8 @@ config.synthesis$ = "_DISABLED_" config.input$ = "Microphone" config.showBackground = 1 sgc2.noiseThresshold = -30 -config.strict = 0 +config.strict$ = "1" +sgc.highestLevel = 3 config.savePerf = 0 config.openPerf = 0 config.clearSummary = 0 @@ -381,7 +382,7 @@ procedure set_up_TTS sgc2.synthesizer = -1 endif # Note, the TTScommand must set sgc2.synthesizer! - if config.strict + if config.strict$ = "'sgc.highestLevel'" 'sgc2.advancedTTScommand$' else 'sgc2.normalTTScommand$' diff --git a/MainPage.praat b/MainPage.praat index 12e26c7..cea1050 100644 --- a/MainPage.praat +++ b/MainPage.praat @@ -360,10 +360,15 @@ endproc procedure recognizeTone select Table 'wordlist$' if te.currentWord > 0 and te.currentWord <= te.numberOfWords + .strict = 0 + if index_regex(config.strict$, "[^0-9]") <= 0 + .strict = ('config.strict$' >= sgc.highestLevel) + endif + .sound$ = Get value... 'te.currentWord' Sound sgc.pinyin$ = Get value... 'te.currentWord' Pinyin call align_recordedSound 'sgc.pinyin$' - call sgc_ToneProt 'recordedSound$' 'sgc.pinyin$' 'config.register' 'config.strict' 'config.language$' + call sgc_ToneProt 'recordedSound$' 'sgc.pinyin$' 'config.register' '.strict' 'config.language$' # sgc_ToneProt manipulates the sound given. Reconnect select Sound 'recordedSound$' te.recordedSound = selected("Sound") @@ -388,7 +393,7 @@ procedure write_feedback .table$ .color$ = "Black" elsif .label$ = "Correct" .color$ = "Green" - elsif config.strict + elsif config.strict$ = "'sgc.highestLevel'" .line2$ = .line2$ + " *" endif diff --git a/ToneProt/SGC_ToneProt.praat b/ToneProt/SGC_ToneProt.praat index 70f0275..3e8ead1 100644 --- a/ToneProt/SGC_ToneProt.praat +++ b/ToneProt/SGC_ToneProt.praat @@ -37,7 +37,6 @@ procedure sgc_ToneProt sgc_ToneProt.currentSound$ sgc_ToneProt.pinyin$ sgc_ToneP endif # Stick to the raw recognition results or not sgc_ToneProt.ultraStrict = sgc_ToneProt.proficiency - # Read and select the feedbacktext call loadTable ToneFeedback_'sgc_ToneProt.language$' diff --git a/ToneProt/ToneRecognition.praat b/ToneProt/ToneRecognition.praat index 4291ff7..60f9863 100644 --- a/ToneProt/ToneRecognition.praat +++ b/ToneProt/ToneRecognition.praat @@ -20,6 +20,18 @@ procedure FreeToneRecognition .pinyin$ .test_word$ .exclude$ .upperRegister .fre # Bias Z-normalized value of the distance difference between smallest and correct .biasDistance = 1.1 + if index_regex(config.strict$, "[^0-9]") <= 0 + .tmp = 'config.strict$' + if .tmp = 0 + .biasDistance = 1.7 + elsif .tmp = 1 + .biasDistance = 1.1 + elsif .tmp = 2 + .biasDistance = 0.6 + elsif .tmp = 3 + .biasDistance = 0.3 + endif + endif # Debugging .keepIntermediates = 0 diff --git a/ToneProt/ToneScript.praat b/ToneProt/ToneScript.praat index 0e51ae9..3c3276b 100644 --- a/ToneProt/ToneScript.praat +++ b/ToneProt/ToneScript.praat @@ -328,7 +328,11 @@ procedure generateWord toneScript.whatToGenerate$ toneScript.theWord$ toneScript Remove # Then look if "real" model exists, and use that - if config.strict + if index_regex(config.strict$, "[^0-9]") > 0 + config.strict$ = "1" + endif + .userLevel = 'config.strict$' + if 0 and .userLevel >= sgc.highestLevel ... and (fileReadable("'preferencesAppDir$'/pitchmodels/'toneScript.theWord$'.Pitch") ... or fileReadable("'preferencesAppDir$'/pitchmodels/'toneScript.theWord$'.wav")) # Get mean of generated contour diff --git a/sgc2.praat b/sgc2.praat index 473dea3..c2431aa 100644 --- a/sgc2.praat +++ b/sgc2.praat @@ -180,6 +180,11 @@ procedure Draw_all_buttons .table$ elsif '.variableName$' < 0 .pressed = -1 endif + elsif index(.variableName$, "_") <= 0 and variableExists("'.variableName$'$") + # Non zero: Pressed + if '.variableName$'$ <> "" and '.variableName$'$ <> "0" + .pressed = 2 + endif # Complex buttons with an variableName+'_'+value structure # varableName$ -> name of button, e.g., "language" elsif index(.variableName$, "_") -- 2.11.4.GIT