Public Access
Add inactivity safeguard and speaker diagnostics
PR and Push Build/Test / build-and-test (push) Failing after 8m31s
PR and Push Build/Test / build-and-test (push) Failing after 8m31s
This commit is contained in:
@@ -63,6 +63,13 @@ public sealed class AzureSpeechSpeakerIdentityMatcher : ISpeakerIdentityMatcher
|
||||
return null;
|
||||
}
|
||||
|
||||
logger.LogInformation(
|
||||
"Speaker identity matching {DiarizedSpeaker} composite layout: unknown {UnknownStart}-{UnknownEnd}, {KnownSegmentCount} known segment(s) across identity ids {IdentityIds}",
|
||||
request.DiarizedSpeaker,
|
||||
layout.UnknownSegment.Value.Start,
|
||||
layout.UnknownSegment.Value.End,
|
||||
layout.KnownSegments.Count,
|
||||
string.Join(", ", layout.KnownSegments.Select(segment => segment.IdentityId).Distinct().Order()));
|
||||
var segments = await DiarizeWithTimeoutAsync(tempPath, cancellationToken);
|
||||
if (segments.Count == 0)
|
||||
{
|
||||
@@ -76,6 +83,16 @@ public sealed class AzureSpeechSpeakerIdentityMatcher : ISpeakerIdentityMatcher
|
||||
"Speaker identity matching {DiarizedSpeaker} received {SegmentCount} diarized segment(s)",
|
||||
request.DiarizedSpeaker,
|
||||
segments.Count);
|
||||
foreach (var segment in segments.OrderBy(segment => segment.Start))
|
||||
{
|
||||
logger.LogInformation(
|
||||
"Speaker identity matching {DiarizedSpeaker} diarized turn {Start}-{End} as {Speaker}",
|
||||
request.DiarizedSpeaker,
|
||||
segment.Start,
|
||||
segment.End,
|
||||
segment.Speaker);
|
||||
}
|
||||
|
||||
var unknownSpeaker = FindBestSpeaker(layout.UnknownSegment.Value, segments);
|
||||
if (string.IsNullOrWhiteSpace(unknownSpeaker))
|
||||
{
|
||||
@@ -93,6 +110,14 @@ public sealed class AzureSpeechSpeakerIdentityMatcher : ISpeakerIdentityMatcher
|
||||
unknownSpeaker,
|
||||
StringComparison.Ordinal));
|
||||
var requiredMatches = known.Count() > 1 ? 2 : 1;
|
||||
logger.LogInformation(
|
||||
"Speaker identity matching {DiarizedSpeaker} compared unknown speaker {UnknownSpeaker} with identity {IdentityId}: {MatchingSnippetCount}/{KnownSnippetCount} matching known snippet(s), required {RequiredMatches}",
|
||||
request.DiarizedSpeaker,
|
||||
unknownSpeaker,
|
||||
known.Key,
|
||||
matchingSnippetCount,
|
||||
known.Count(),
|
||||
requiredMatches);
|
||||
if (matchingSnippetCount >= requiredMatches)
|
||||
{
|
||||
var validationRequest = new SpeakerIdentityMatchValidationRequest(
|
||||
|
||||
Reference in New Issue
Block a user