{"id":28799703,"url":"https://github.com/avanigupta06/chaptify","last_synced_at":"2025-06-25T16:05:13.837Z","repository":{"id":298051340,"uuid":"998681327","full_name":"avanigupta06/Chaptify","owner":"avanigupta06","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-09T05:30:19.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-18T07:01:43.315Z","etag":null,"topics":["ffmpeg","flask","html","keybert","mbart","whisper-ai","yt-dlp"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avanigupta06.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-09T04:44:08.000Z","updated_at":"2025-06-09T05:36:32.000Z","dependencies_parsed_at":"2025-06-09T06:37:30.596Z","dependency_job_id":null,"html_url":"https://github.com/avanigupta06/Chaptify","commit_stats":null,"previous_names":["avanigupta06/chaptify"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/avanigupta06/Chaptify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanigupta06%2FChaptify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanigupta06%2FChaptify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanigupta06%2FChaptify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanigupta06%2FChaptify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avanigupta06","download_url":"https://codeload.github.com/avanigupta06/Chaptify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avanigupta06%2FChaptify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260506986,"owners_count":23019449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffmpeg","flask","html","keybert","mbart","whisper-ai","yt-dlp"],"created_at":"2025-06-18T07:00:25.281Z","updated_at":"2025-06-25T16:05:13.815Z","avatar_url":"https://github.com/avanigupta06.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔊 Chatify – YouTube Video Chaptering \u0026 Summarization Tool\n\n**Chatify** is an AI-powered Flask web application that takes a YouTube video URL and automatically generates meaningful **chapter-wise summaries** and **titles** from spoken Hindi or Hinglish content. It uses **OpenAI's Whisper**, **mBART**, and **KeyBERT** to convert speech to text, summarize it, and generate chapter titles. The output is a clean, timestamped JSON file—ideal for content indexing, accessibility, or quick navigation.\n\n---\n\n## 🧰 Tech Stack\n\n### 🖥️ Backend\n- **Flask** — Lightweight Python web framework for handling routes and requests.\n\n### 🧠 Machine Learning \u0026 NLP\n- **Whisper (by OpenAI)** — For speech-to-text transcription from Hindi/Hinglish audio.\n- **mBART (by Facebook AI)** — For abstractive summarization and Hindi → English translation.\n- **KeyBERT** — For keyword-based title generation using BERT embeddings.\n\n### 🎥 Audio \u0026 Video Processing\n- **yt-dlp** — For downloading audio from YouTube videos.\n- **ffmpeg** — For converting and processing audio formats (MP4 → MP3/WAV).\n\n### 📁 File Handling \u0026 Utilities\n- **uuid** — For generating unique job identifiers.\n- **pathlib / os / json** — For safe file and directory operations.\n\n### 🌐 Frontend\n- **HTML** — For rendering dynamic content using Flask templates.\n\n### 📝 Output\n- **JSON** — Chapters with timestamps, titles, and summaries.\n\n---\n\n## 🚀 Features\n\n- 🎥 Accepts a YouTube video URL as input  \n- 🧠 Converts spoken Hindi/Hinglish content into English summaries  \n- 🕐 Breaks videos into timestamped chapters (default: every 5 minutes)  \n- 📝 Generates meaningful chapter titles using keyword extraction  \n- 📁 Generates a structured `.json` file containing start time, title, and summary  \n- 🌐 Simple Flask UI to interact with the tool via browser  \n\n---\n\n## 📂 Project Structure\n\n```text\nchatify/\n├── app.py                  # Flask application entry point\n├── workspace/              # Temporary folder to store job-specific files\n├── templates/\n│   └── index.html          # Main web interface\n├── static/\n│   └── style.css           # Web design\n├── trail/                  # Demo files (sample output)\n│   ├── try.ipynb\n│   └── chapters.ipynb\n├── pipeline/\n│   ├── downloader.py       # Uses yt-dlp to extract audio from YouTube\n│   ├── transcriber.py      # Whisper transcription + transcript saver\n│   ├── chapterizer.py      # Chunking + summarization + title generation\n│   └── utils.py            # Time conversion utilities\n\n```\n---\n\n## 🔧 Pipeline Explanation\n\n### 1. 🎥 Input: YouTube Video Link\n- The user provides a YouTube video URL.\n- The audio stream is extracted and saved as an MP3 using `yt-dlp` and `ffmpeg`.\n\n### 2. 🗣️ ASR (Automatic Speech Recognition) with Whisper\n- Audio is transcribed using OpenAI's **Whisper** model.\n- **Output**: Timestamped transcript in Hindi/Hinglish.\n- **Format**: `[start_time - end_time]: text`\n\n### 3. 🧹 Preprocessing\n- The transcript is cleaned and formatted.\n- Each segment includes a timestamp and its corresponding spoken content.\n\n### 4. 🧩 Chunking into Segments\n- The transcript is split into fixed-length chunks (e.g., 300 seconds = 5 minutes).\n- Timestamp alignment is preserved.\n- Each chunk is treated as a potential chapter.\n\n### 5. 🧠 Summarization using mBART\n- Each chunk is summarized using **mBART**, a multilingual transformer fine-tuned for Hindi-to-English summarization.\n- **Output**: Concise English summary of the chunk’s content.\n\n### 6. 🏷️ Chapter Title Generation with KeyBERT\n- Using **KeyBERT**, important keywords are extracted from each summary.\n- The most relevant keyword or phrase is selected as the chapter title.\n\n### 7. 📦 Chapter Assembly\n- For each chunk, the following are saved:\n  - `start_time`\n  - `summary`\n  - `title`\n- Final output is stored as a structured `.json` file.\n\n---\n\n## ✅ Example Output\n\n```json\n[\n  {\n    \"start_time\": \"0:00:00\",\n    \"title\": \"Social Professions\",\n    \"summary\": \"The speaker discusses how certain professions like tea vendors, garbage collectors, and dancers are perceived with bias in Indian society...\"\n  },\n  {\n    \"start_time\": \"0:05:00\",\n    \"title\": \"Education Challenges\",\n    \"summary\": \"The video highlights problems in the Indian education system including outdated curriculum, exam pressure, and limited access in rural areas...\"\n  }\n]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favanigupta06%2Fchaptify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favanigupta06%2Fchaptify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favanigupta06%2Fchaptify/lists"}