Files
meeting-assistant/MeetingAssistant/Speakers/SpeakerIdentificationModels.cs
T

65 lines
1.9 KiB
C#

using MeetingAssistant.MeetingNotes;
using MeetingAssistant.Transcription;
namespace MeetingAssistant.Speakers;
public sealed record SpeakerIdentificationRequest(
string AudioPath,
MeetingNote MeetingNote,
IReadOnlyList<TranscriptionSegment> Segments,
IReadOnlyList<SpeakerAudioSample>? Samples = null);
public sealed record SpeakerAudioSample(
string Speaker,
TranscriptionSegment Segment,
byte[] WavBytes,
double Score);
public sealed record SpeakerIdentificationResult(
IReadOnlyList<TranscriptionSegment> Segments,
IReadOnlyDictionary<string, string> SpeakerMappings,
IReadOnlyList<SpeakerIdentityAttendeeMatch>? AttendeeMatches = null);
public sealed record SpeakerIdentityAttendeeMatch(
string DisplayName,
IReadOnlyList<string> AcceptedNames);
public sealed record SpeakerIdentityMatchRequest(
string DiarizedSpeaker,
byte[] UnknownSnippet,
IReadOnlyList<SpeakerIdentityMatchCandidate> Candidates);
public sealed record SpeakerIdentityMatchCandidate(
int IdentityId,
string? CanonicalName,
int TranscriptionCount,
IReadOnlyList<byte[]> Snippets);
public sealed record SpeakerIdentityMatch(int IdentityId);
public interface ISpeakerIdentityMatcher
{
Task<SpeakerIdentityMatch?> MatchAsync(
SpeakerIdentityMatchRequest request,
CancellationToken cancellationToken);
}
public interface ISpeakerSnippetExtractor
{
Task<byte[]> ExtractSnippetAsync(
string audioPath,
IReadOnlyList<TranscriptionSegment> speakerSegments,
CancellationToken cancellationToken);
}
public interface ISpeakerIdentificationService
{
Task<SpeakerIdentificationResult> IdentifyKnownSpeakersAsync(
SpeakerIdentificationRequest request,
CancellationToken cancellationToken);
Task<SpeakerIdentificationResult> ProcessFinishedTranscriptAsync(
SpeakerIdentificationRequest request,
CancellationToken cancellationToken);
}