import os
from improve_diarization_with_llm import claude_corrector
'ANTHROPIC_API_KEY'] = 'your-api-key' # Replace with your actual API key os.environ[
Claude Improve
A tool for correcting speaker diarization transcripts using Claude AI accessed through the Claudette tool.
Install
pip install improve_diarization_with_llm
Core Functionality
ClaudeDiarizationCorrector
ClaudeDiarizationCorrector (input_path:str, output_path:str, chunk_size:int=20000)
*Initialize the ClaudeDiarizationCorrector.
Args: input_path (str): Path to the input diarization transcript file. output_path (str): Path where the corrected transcript will be saved. chunk_size (int, optional): Maximum size of each chunk for processing. Defaults to 20000.*
Example Usage
Here’s a step-by-step example of how to use the ClaudeDiarizationCorrector
in your own Python script or notebook:
- Next, create a
ClaudeDiarizationCorrector
object with your input and output file paths:
= 'path/to/your/input/transcript.txt' # Replace with your actual input file path
input_file = 'path/to/your/output/improved_transcript.txt' # Replace with your desired output file path
output_file
= claude_corrector.ClaudeDiarizationCorrector(input_file, output_file) corrector
- Finally, process the conversation:
= corrector.process_conversation()
corrected_transcript print("Correction complete. Check the output file for results.")