Compartilhar via


PronunciationAssessmentConfig Class

  • java.lang.Object
    • com.microsoft.cognitiveservices.speech.PronunciationAssessmentConfig

Implements

java.lang.AutoCloseable

public final class PronunciationAssessmentConfig
implements java.lang.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

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-parameters

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

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

Method Summary

Modifier and Type Method and Description
void applyTo(Recognizer recognizer)

Applies the settings in this config to a recognizer.

void close()

Explicitly frees any external resource attached to the object

void enableContentAssessmentWithTopic(String topic)

Enables content assessment with specified topic.

void enableProsodyAssessment()

Enables prosody assessment.

static PronunciationAssessmentConfig fromJson(String json)

Creates an instance of the PronunciationAssessmentConfig from a json string

SafeHandle getImpl()

Returns the PronunciationAssessmentConfig

java.lang.String getReferenceText()

Gets the reference text.

void setNBestPhonemeCount(int count)

Sets the nbest phoneme alphabet

void setPhonemeAlphabet(String value)

Sets the phoneme alphabet

void setReferenceText(String value)

Sets the reference text.

java.lang.String toJson()

Gets the json string of pronunciation assessment parameters.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

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

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 text
gradingSystem - The point system for score calibration
granularity - The evaluation granularity

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 text
gradingSystem - The point system for score calibration
granularity - The evaluation granularity
enableMiscue - 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.

Method Details

applyTo

public void applyTo(Recognizer recognizer)

Applies the settings in this config to a recognizer.

Parameters:

recognizer - The target recognizer.

close

public void close()

Explicitly frees any external resource attached to the object

enableContentAssessmentWithTopic

public void enableContentAssessmentWithTopic(String topic)

Enables content assessment with specified topic.

Parameters:

topic - the content topic.

enableProsodyAssessment

public void enableProsodyAssessment()

Enables prosody assessment.

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.

getImpl

public SafeHandle getImpl()

Returns the PronunciationAssessmentConfig

Returns:

The implementation of the PronunciationAssessmentConfig object

getReferenceText

public String getReferenceText()

Gets the reference text.

Returns:

The reference text.

setNBestPhonemeCount

public void setNBestPhonemeCount(int count)

Sets the nbest phoneme alphabet

Parameters:

count - the nbest phoneme count.

setPhonemeAlphabet

public void setPhonemeAlphabet(String value)

Sets the phoneme alphabet

Parameters:

value - the reference text.

setReferenceText

public void setReferenceText(String value)

Sets the reference text.

Parameters:

value - the reference text.

toJson

public String toJson()

Gets the json string of pronunciation assessment parameters.

Returns:

json string of pronunciation assessment parameters.

Applies to