Implementation of automatic interview transcription. Interview transcription is needed by journalists, HR specialists, and researchers. Key requirements: accurate attribution of lines between two speakers (interviewer/respondent), preservation of pauses and intonation markers, and support for question-answer formatting. ### Quick solution via API
import assemblyai as aai
config = aai.TranscriptionConfig(
language_code="ru",
speaker_labels=True, # диаризация 2 говорящих
speakers_expected=2,
punctuate=True,
format_text=True,
)
transcriber = aai.Transcriber(config=config)
transcript = transcriber.transcribe("interview.mp3")
# Форматирование в стиле интервью
output = []
current_speaker = None
for utterance in transcript.utterances:
if utterance.speaker != current_speaker:
label = "— " if current_speaker else ""
output.append(f"\n**Спикер {utterance.speaker}:** {utterance.text}")
current_speaker = utterance.speaker
else:
output.append(utterance.text)
print("\n".join(output))
```### Self-hosted with Q&A formatting```python
async def format_as_interview(transcript: dict) -> str:
"""Форматируем транскрипт в стиль интервью"""
turns = transcript["turns"]
response = await client.chat.completions.create(
model="gpt-4o",
messages=[{
"role": "system",
"content": """Отформатируй транскрипт как журналистское интервью:
- Определи кто интервьюер, кто респондент
- Добавь метки: [Вопрос] / [Ответ] или имена если известны
- Исправь очевидные ошибки распознавания
- Сохрани оригинальные слова"""
}, {
"role": "user",
"content": "\n".join(f"Спикер {t['speaker']}: {t['text']}" for t in turns)
}]
)
return response.choices[0].message.content
```### Export formats for different platforms - **Medium / Substack**: Markdown with bold names - **Word**: standard interview formatting - **Notion**: automatic page generation via API Transcription cost via AssemblyAI: 1 hour of interview ≈ $0.72. Via Whisper self-hosted: ~$0.01–$0.05 (GPU cost). Timeframe: basic transcription script + formatting — 1–2 days. Web service with file upload — 3–5 days.







