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


source

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:

import os
from improve_diarization_with_llm import claude_corrector
    
os.environ['ANTHROPIC_API_KEY'] = 'your-api-key'  # Replace with your actual API key
  1. Next, create a ClaudeDiarizationCorrector object with your input and output file paths:
input_file = 'path/to/your/input/transcript.txt'  # Replace with your actual input file path
output_file = 'path/to/your/output/improved_transcript.txt'  # Replace with your desired output file path
    
corrector = claude_corrector.ClaudeDiarizationCorrector(input_file, output_file)
  1. Finally, process the conversation:
corrected_transcript = corrector.process_conversation()
print("Correction complete. Check the output file for results.")