-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(Azure STT): add an option to use the lexical form of the transcription #4350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(Azure STT): add an option to use the lexical form of the transcription #4350
Conversation
|
thanks for the PR, could you run |
| detailed_result = json.loads(evt.result.json) | ||
| lexical = detailed_result.get("NBest", [{}])[0].get("Lexical", None) | ||
| except Exception as e: | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exception should be logged at a minimum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Thank you for the comment
| detailed_result = json.loads(evt.result.json) | ||
| lexical = detailed_result.get("NBest", [{}])[0].get("Lexical", None) | ||
| except Exception as e: | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment here
theomonnom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
| profanity: NotGivenOr[speechsdk.enums.ProfanityOption] = NOT_GIVEN | ||
| phrase_list: NotGivenOr[list[str] | None] = NOT_GIVEN | ||
| explicit_punctuation: bool = False | ||
| lexical_output: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lexical_output isn't exposed since STTOptions is private.
Can you add it to the constructor?
How did you test the PR?
This PR introduces optional support for returning Azure Speech-to-Text results in lexical format.
✨ What’s new
🔄 Backward compatibility
🧩 Motivation
Some downstream use cases (e.g. custom NLU pipelines, post-processing, or domain-specific text handling) require access to the raw lexical transcription provided by Azure, rather than the normalized output. This change makes that possible without affecting existing integrations.
⚙️ Usage
STTOptions.