Class 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 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 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.
      • 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)
        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:
        close in interface AutoCloseable
      • 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