Hello Speech-To-Text team,
By referring to Connection class API doc https://learn.microsoft.com/en-us/java/api/com.microsoft.cognitiveservices.speech.connection?view=azure-java-stable#com-microsoft-cognitiveservices-speech-connection-setmessageproperty(java-lang-string-java-lang-string-java-lang-string), with Speech Java SDK 1.34.0 i'm trying to config disfluency removal feature by using below code:
import com.microsoft.cognitiveservices.speech.*;
SpeechConfig config = SpeechConfig.fromSubscription("<key>", "<region>");
SpeechRecognizer recognizer = new SpeechRecognizer(config, "zh-CN");
Connection connect = Connection.fromRecognizer(recognizer);
connect.setMessageProperty("speech.context", "phraseDetection",
"{\"enrichment\":{\"Interactive\":{\"PunctuationMode\":\"Implicit\",\"DisfluencyMode\":\"Removed\"},\"Dictation\":{\"PunctuationMode\":\"Explicit\",\"DisfluencyMode\":\"Removed\"},\"Conversation\":{\"PunctuationMode\":\"Implicit\",\"DisfluencyMode\":\"Removed\"}}}");
recognizer.recognized.addEventListener((s, e) -> {
if (e.getResult().getReason() == ResultReason.RecognizedSpeech) { System.out.println("RECOGNIZ-ED: Text=" + e.getResult().getProperties().getProperty(PropertyId.SpeechServiceResponse_JsonResult)); }});
recognizer.canceled.addEventListener((s, e) -> {
if (e.getReason() == CancellationReason.Error) { System.out.println("CANCELED: ErrorCode=" + e.getErrorCode()); System.out.println("CANCELED: ErrorDetails=" + e.getErrorDetails()); }});
recognizer.startContinuousRecognitionAsync().get();
However, i don't see the disfluency is removed by only get below error message from SDK:
CANCELED: ErrorCode=BadRequest
CANCELED: ErrorDetails=Connection was closed by the remote host. Error code: 1007. Error details: Invalid 'language' query parameter or unknown custom deployment. SessionId: c8f90ba659104ca49cff9944cdccc01a
Would you please help to check this issue ?
Thank you.