Class PronunciationAssessmentConfig
- java.lang.Object
-
- com.microsoft.cognitiveservices.speech.PronunciationAssessmentConfig
-
- All Implemented Interfaces:
AutoCloseable
public final class PronunciationAssessmentConfig extends Object implements AutoCloseable
Represents pronunciation assessment configuration. Note: close() must be called in order to release underlying resources held by the object. Added in version 1.14.0
-
-
Constructor Summary
Constructors Constructor Description PronunciationAssessmentConfig(String referenceText)Initializes an instance of the PronunciationAssessmentConfig For the parameters details, see https://docs.microsoft.com/azure/cognitive-services/speech-service/rest-speech-to-text#pronunciation-assessment-parametersPronunciationAssessmentConfig(String referenceText, PronunciationAssessmentGradingSystem gradingSystem, PronunciationAssessmentGranularity granularity)Initializes an instance of the PronunciationAssessmentConfig For the parameters details, see https://docs.microsoft.com/azure/cognitive-services/speech-service/rest-speech-to-text#pronunciation-assessment-parametersPronunciationAssessmentConfig(String referenceText, PronunciationAssessmentGradingSystem gradingSystem, PronunciationAssessmentGranularity granularity, boolean enableMiscue)Initializes an instance of the PronunciationAssessmentConfig For the parameters details, see https://docs.microsoft.com/azure/cognitive-services/speech-service/rest-speech-to-text#pronunciation-assessment-parameters
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyTo(Recognizer recognizer)Applies the settings in this config to a recognizer.voidclose()Explicitly frees any external resource attached to the objectvoidenableContentAssessmentWithTopic(String topic)Enables content assessment with specified topic.voidenableProsodyAssessment()Enables prosody assessment.static PronunciationAssessmentConfigfromJson(String json)Creates an instance of the PronunciationAssessmentConfig from a json stringSafeHandlegetImpl()Returns the PronunciationAssessmentConfigStringgetReferenceText()Gets the reference text.voidsetNBestPhonemeCount(int count)Sets the nbest phoneme alphabetvoidsetPhonemeAlphabet(String value)Sets the phoneme alphabetvoidsetReferenceText(String value)Sets the reference text.StringtoJson()Gets the json string of pronunciation assessment parameters.
-
-
-
Constructor Detail
-
PronunciationAssessmentConfig
public PronunciationAssessmentConfig(String referenceText, PronunciationAssessmentGradingSystem gradingSystem, PronunciationAssessmentGranularity granularity, boolean enableMiscue)
Initializes an instance of the PronunciationAssessmentConfig For the parameters details, see https://docs.microsoft.com/azure/cognitive-services/speech-service/rest-speech-to-text#pronunciation-assessment-parameters- Parameters:
referenceText- The reference textgradingSystem- The point system for score calibrationgranularity- The evaluation granularityenableMiscue- If enables miscue calculation. When true, the pronounced words are compared to the reference text, and are marked with omission/insertion based on the comparison; when false, the recognized text will always be reference text.
-
PronunciationAssessmentConfig
public PronunciationAssessmentConfig(String referenceText, PronunciationAssessmentGradingSystem gradingSystem, PronunciationAssessmentGranularity granularity)
Initializes an instance of the PronunciationAssessmentConfig For the parameters details, see https://docs.microsoft.com/azure/cognitive-services/speech-service/rest-speech-to-text#pronunciation-assessment-parameters- Parameters:
referenceText- The reference textgradingSystem- The point system for score calibrationgranularity- The evaluation granularity
-
PronunciationAssessmentConfig
public PronunciationAssessmentConfig(String referenceText)
Initializes an instance of the PronunciationAssessmentConfig For the parameters details, see https://docs.microsoft.com/azure/cognitive-services/speech-service/rest-speech-to-text#pronunciation-assessment-parameters- Parameters:
referenceText- The reference text
-
-
Method Detail
-
fromJson
public static PronunciationAssessmentConfig fromJson(String json)
Creates an instance of the PronunciationAssessmentConfig from a json string- Parameters:
json- the json string- Returns:
- The pronunciation assessment configuration being created.
-
close
public void close()
Explicitly frees any external resource attached to the object- Specified by:
closein interfaceAutoCloseable
-
setReferenceText
public void setReferenceText(String value)
Sets the reference text.- Parameters:
value- the reference text.
-
getReferenceText
public String getReferenceText()
Gets the reference text.- Returns:
- The reference text.
-
setPhonemeAlphabet
public void setPhonemeAlphabet(String value)
Sets the phoneme alphabet- Parameters:
value- the reference text.
-
setNBestPhonemeCount
public void setNBestPhonemeCount(int count)
Sets the nbest phoneme alphabet- Parameters:
count- the nbest phoneme count.
-
enableProsodyAssessment
public void enableProsodyAssessment()
Enables prosody assessment.
-
enableContentAssessmentWithTopic
public void enableContentAssessmentWithTopic(String topic)
Enables content assessment with specified topic.- Parameters:
topic- the content topic.
-
toJson
public String toJson()
Gets the json string of pronunciation assessment parameters.- Returns:
- json string of pronunciation assessment parameters.
-
applyTo
public void applyTo(Recognizer recognizer)
Applies the settings in this config to a recognizer.- Parameters:
recognizer- The target recognizer.
-
getImpl
public SafeHandle getImpl()
Returns the PronunciationAssessmentConfig- Returns:
- The implementation of the PronunciationAssessmentConfig object
-
-