CoolFace
Apppublic

abdulshakur/YT-TranscriptSegmenter

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
README.md88 linesDownload Raw Back to root
1---2title: YT TranscriptSegmenter3emoji: ✂️4colorFrom: green5colorTo: blue6sdk: gradio7sdk_version: 5.22.08app_file: app.py9pinned: false10license: mit11short_description: Takes YT transcript, any length, intelligently splits12---13 14# Transcript Segmenter15 16This tool intelligently segments long transcripts into smaller, manageable chunks that can be processed by LLM-based analyzers.17 18## Features19 20- Split transcripts at sentence boundaries to maintain coherence21- Customize maximum segment length22- Get detailed statistics about each segment23- API endpoint for programmatic access24- Works with any transcript (YouTube, meeting, podcast, etc.)25 26## How to Use27 28### Web Interface29 301. Paste your full transcript in the input box312. Adjust the maximum segment length if needed323. Keep "Use smart sentence boundaries" checked for better results334. Click "Segment Transcript"345. View and copy the segmented transcript35 36### API Usage37 38This tool can be called programmatically using the Gradio client:39 40```python41from gradio_client import Client42 43client = Client("https://your-space-name.hf.space")44segments, count, stats = client.predict(45    "Your full transcript text here",  # Input transcript46    1500,                              # Max segment length47    True,                              # Use smart boundaries48    fn_index=049)50```51 52## How It Works53 54The segmenter uses NLTK's sentence tokenizer to identify natural sentence boundaries in the text. It then builds segments that:55 561. Stay under the maximum token limit572. Preserve complete sentences whenever possible583. Include metadata about segment position59 60This approach creates more coherent segments that can be analyzed individually while maintaining context.61 62 63## How It Works64 65The segmenter uses NLTK's sentence tokenizer to identify natural sentence boundaries in the text. It then builds segments that:66 671. Stay under the maximum token limit682. Preserve complete sentences whenever possible693. Include metadata about segment position70 71This approach creates more coherent segments that can be analyzed individually while maintaining context.72 73## Integration with Analyzers74 75This segmenter is designed to work with LLM-based transcript analyzers. After segmenting a transcript, you can:76 771. Process each segment individually with an analyzer782. Combine the analyses for a complete understanding of the full transcript793. Avoid token limit errors that occur with long transcripts80 81## Limitations82 83- Works best when transcripts have proper punctuation84- Very long sentences without punctuation may still be truncated85- Running on free Spaces infrastructure with limited computational resources86 87Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference88