plexus.processors.AddEnumeratedSpeakerIdentifiersTranscriptFilter module

class plexus.processors.AddEnumeratedSpeakerIdentifiersTranscriptFilter.AddEnumeratedSpeakerIdentifiersTranscriptFilter(**parameters)

Bases: DataframeProcessor

Replace speaker identifiers with enumerated labels (Speaker A, Speaker B, etc.).

This processor does a two-pass operation: 1. First pass: Identify all unique speaker identifiers in the order they appear 2. Second pass: Replace each speaker identifier with Speaker A, Speaker B, etc.

Example:

Before: “Agent: Hello. Customer: Hi. Agent: How are you?” After: “Speaker A: Hello. Speaker B: Hi. Speaker A: How are you?”

enumerate_speakers(text: str) str

Replace speaker identifiers with enumerated labels.

Args:

text: Input text with speaker identifiers

Returns:

Text with speakers replaced by Speaker A, Speaker B, etc.

process(dataframe: DataFrame) DataFrame