-
Notifications
You must be signed in to change notification settings - Fork 11
add batch speaker id docs #133
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9da1ab7
add batch speaker id docs
893fbbe
add a recommended limit on the number of speaker ids
25f5d0e
update max identifiers comment
fce8b6d
update the public specs
94b3b72
fix JSON boolean flag
1e594f7
fix hyperlinkgs
b0fa881
Rephrase one sentence about get_speakers option.
1108c98
fix redirects
ac0825e
fix redirects
f195ba8
add missing backticks
73e4e53
post rebase fixes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| --- | ||
| sidebar_label: 'Speaker identification' | ||
| description: "Learn how to use the Speechmatics API to identify speakers in Batch" | ||
| keywords: | ||
| [ | ||
| speechmatics, | ||
| batch, | ||
| diarization, | ||
| transcription, | ||
| speech recognition, | ||
| automatic speech recognition, | ||
| asr, | ||
| ] | ||
| sidebar_position: 2 | ||
| --- | ||
|
|
||
| import DocCardList from '@theme/DocCardList'; | ||
| import { Card, DataList, Text } from '@radix-ui/themes'; | ||
|
|
||
| # Batch speaker identification | ||
|
|
||
| :::tip | ||
| For an overview of the feature, see the [speaker identification](/speech-to-text/features/speaker-identification) page. | ||
| ::: | ||
|
|
||
| ## Enrollment | ||
|
|
||
| To generate identifiers for a desired speaker, run a [speaker diarization](/speech-to-text/features/diarization#diarization-modes) enabled transcription on an audio sample where the speaker is ideally speaking alone. | ||
| You can request the identifiers back from the engine by setting the `get_speakers` flag in the transcription config: | ||
|
|
||
| ```json | ||
| { | ||
| "type": "transcription", | ||
| "transcription_config": { | ||
| "language": "en", | ||
| "diarization": "speaker" | ||
| "speaker_diarization_config": { | ||
| // highlight-start | ||
| "get_speakers": true | ||
| // highlight-end | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| When the transcription is done, the speakers identifiers will be attached to the returned transcript: | ||
|
|
||
| ```json | ||
| { | ||
| "results": [ | ||
| { | ||
| "alternatives": [ | ||
| { | ||
| "confidence": 0.93, | ||
| "content": "Hello", | ||
| "language": "en", | ||
| "speaker": "S1" | ||
| } | ||
| ], | ||
| ... | ||
| }, | ||
| { | ||
| "alternatives": [ | ||
| { | ||
| "confidence": 1.0, | ||
| "content": "Hi", | ||
| "language": "en", | ||
| "speaker": "S2" | ||
| } | ||
| ], | ||
| ... | ||
| }], | ||
| // highlight-start | ||
| "speakers": [ | ||
| { | ||
| "label": "S1", | ||
| "speaker_identifiers": ["<id1>"] | ||
| }, | ||
| { | ||
| "label": "S2", | ||
| "speaker_identifiers": ["<id2>"] | ||
| }] | ||
| // highlight-end | ||
| } | ||
| ``` | ||
|
|
||
| ## Identification | ||
|
|
||
| Once you have generated speaker identifiers, you can provide them in your next transcription job to identify and tag known speakers. This is done through the `speakers` option in the speaker diarization configuration. All other [speaker diarization options](/speech-to-text/batch/batch-diarization#configuration) remain supported. Notably, the `speakers_sensitivity` parameter can be used to adjust how strongly the system prefers enrolled speakers over detecting new generic ones, where lower values make it more likely to match existing enrolled speakers. | ||
|
|
||
| An example configuration is shown below: | ||
|
|
||
| ```json | ||
| { | ||
| "type": "transcription", | ||
| "transcription_config": { | ||
| "language": "en", | ||
| "diarization": "speaker", | ||
| "speaker_diarization_config": { | ||
| // highlight-start | ||
| "speakers": [ | ||
| {"label": "Alice", "speaker_identifiers": ["<alice_id1>", "<alice_id2>"]}, | ||
| {"label": "Bob", "speaker_identifiers": ["<bob_id1>"]} | ||
| ] | ||
| // highlight-end | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| With the config above, transcript segments should be tagged with `"Alice"` and `"Bob"` whenever these speakers are detected, whereas any other speakers should be tagged with the internal labels: | ||
|
|
||
| ```json | ||
| { | ||
| "results": [ | ||
| { | ||
| "alternatives": [ | ||
| { | ||
| "confidence": 0.93, | ||
| "content": "Morning", | ||
| "language": "en", | ||
| // highlight-start | ||
| "speaker": "Alice" | ||
| // highlight-end | ||
| } | ||
| ], | ||
| ... | ||
| }, | ||
| { | ||
| "alternatives": [ | ||
| { | ||
| "confidence": 0.93, | ||
| "content": "Hi", | ||
| "language": "en", | ||
| "speaker": "S1" | ||
| } | ||
| ], | ||
| ... | ||
| }, | ||
| { | ||
| "alternatives": [ | ||
| { | ||
| "confidence": 1.0, | ||
| "content": "Morning", | ||
| "language": "en", | ||
| // highlight-start | ||
| "speaker": "Bob" | ||
| // highlight-end | ||
| } | ||
| ], | ||
| }] | ||
| } | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.