{"id":23377707,"url":"https://github.com/pointer2alvee/llm-tv-series-analysis","last_synced_at":"2026-04-11T09:40:54.125Z","repository":{"id":266197115,"uuid":"897669318","full_name":"pointer2Alvee/llm-tv-series-analysis","owner":"pointer2Alvee","description":"A TV-Series analysis system using NLP/LLM , gradio, hugging face , chatbots","archived":false,"fork":false,"pushed_at":"2025-01-19T13:33:45.000Z","size":2667,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T03:20:31.915Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pointer2Alvee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-12-03T03:03:40.000Z","updated_at":"2025-01-19T13:33:46.000Z","dependencies_parsed_at":"2025-01-19T14:43:59.028Z","dependency_job_id":"e62a01c3-ffb8-4a49-bd0b-02d9728da382","html_url":"https://github.com/pointer2Alvee/llm-tv-series-analysis","commit_stats":null,"previous_names":["pointer2alvee/llm-tv-series-analysis"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointer2Alvee%2Fllm-tv-series-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointer2Alvee%2Fllm-tv-series-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointer2Alvee%2Fllm-tv-series-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointer2Alvee%2Fllm-tv-series-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pointer2Alvee","download_url":"https://codeload.github.com/pointer2Alvee/llm-tv-series-analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247779794,"owners_count":20994569,"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":[],"created_at":"2024-12-21T18:18:31.069Z","updated_at":"2026-04-11T09:40:49.082Z","avatar_url":"https://github.com/pointer2Alvee.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"assets/images/1.JPG\" alt=\"Image 1\" style=\"width: 100%; margin: 10px;\"\u003e\n\u003c/div\u003e\n\u003cdiv style=\"display: flex; justify-content: space-around; align-items: center;\"\u003e\n  \u003cimg src=\"assets/images/2.JPG\" alt=\"Image 2\" style=\"width: 100%; margin: 10px;\"\u003e\n\u003c/div\u003e\n\n## 📜 llm-tv-series-analysis\n#### 📌 Summary \nAn NLP/LLM-powered \u003cb\u003eTV-Series-Analysis\u003c/b\u003e System for understanding story elements, character relationships, and theme analysis of any TV show. This AI-system relies on robust tech stack including python, pytorch, gradio, scrapy, beautifulsoup4, glob, sklearn, seaborn, pandas, numpy, matplotlib, spacy, networkx, transformer-models, huggingface, nltk, pyvis. Also used two impressive models, spacy's en_core_web_trf for character network \u0026 hugging face's facebook/bart-large-mnli for theme classifier. Expertise in  ML/DL, AI engineering, Neural nets, LLMs, Transformer models \u0026 web scraping is beneficial for extending or understanding this system.\n\n#### 🧠 Overview\nA comprehensive system to analyze and visualize any TV series —demonstrated here using \"Naruto\" tv seies— with a user-friendly interface built using Gradio. The system is structured into three major components. \n\n\u003cb\u003e(1) Gathering Dataset :\u003c/b\u003e where 3-types of dataset requierd. These are subtitle, transcript, classification dataset. The subtitle is collected \"subtitlist\", the transcript from kaggle and the classification data are scraped from \"narutopedia\" website using Scrapy and BeautifulSoup tool.  \n\n\u003cb\u003e(2) Theme Classification :\u003c/b\u003e basically extracts the main theme of the series. It tells us how much each theme (%) is occurring in the TV-Series provided that we have input themes like (comma separated) : friendship, battle, sacrifice, love, dialogue etc. This is done using zero-shot classifier  by leveraging Hugging Face's \"facebook/bart-large-mnli\" model to extract theme from the subtitle dataset and lastly\n\n\u003cb\u003e (3) Character Network :\u003c/b\u003e shows how big each character is and plot their relationship with each other. This uses SpaCy’s NER (Named-Entity-Recognition) model (en_core_web_trf) to identify and connect character entities in a network visualized via Pyvis.\n\n\n#### 🎯 Use Cases \n- Fandom Analysis \u0026 Exploration\n- Content Recommendation \u0026 Tagging\n- Scriptwriter \u0026 Creator Insights\n- Educational/NLP Research Tool\n- Interactive Dashboards for Viewers\n- Comparative Series Analysis\n- Archiving \u0026 Metadata Generation\n  \n#### 🟢 Project Status\n- Current Version: V1.0\n- Actively maintained \u0026 expanded\n\n#### 📂 Repository Structure\n```\nllm-tv-series-analysis/\n├── assets/\n│   └── images/\n├── crawler/\n│   └── .ass\n├── data/\n│   ├── subtitles/\n│   |   ├── datasets_link.txt\n│   ├── datasets_link.txt\n│   ├── jutsu.jsonl\n│   ├── jutsus.jsnol\n│   └── naturo.csv\n├── stubs/\n│   ├── ner_output.csv\n│   └── theme_classifier_output.csv\n├── text-classification/\n│   └── jutsu_classifier_development.ipynb\n├── theme-classifier/\n│   ├── __init__.py\n│   ├── theme_classification_development.ipynb\n│   └── theme_classifier.py\n├── character-network/\n│   ├── __init__.py\n│   ├── character_network_generator.ipynb\n│   ├── character_network_generator.py\n│   ├── named_entity_recognizer.py\n│   └── naruto.html\n├── utils/\n│   ├── __init__.py\n│   └── data_loader.py         \n├── .gitignore\n├── gradio_app.py\n├── llm-tv-series-analysis.gdoc\n├── llm_tv_series_analysis_development.ipynb\n├── requirements.txt\n└── README.md\n```\n\n### ✨ Features\n✅ Dataset gathering (subtitles, transcripts, and custom classification sets)\n✅ Zero-shot theme classifier using facebook/bart-large-mnli\n✅ Character relationship network using Named Entity Recognition (en_core_web_trf)\n\n🛠️ In progress:\n▫️ Attack type classifier (distilBERT-based)\n▫️ Chatbot with character personality using fine-tuned LLaMA 3.1\n\n### 🎥 Demo\n \u003ca href=\"https://www.youtube.com/shorts/wexIv6X45eE?feature=share\" target=\"_blank\"\u003e\n  \u003cimg src=\"assets/images/2_2.JPG\" alt=\"YouTube Video\" width=\"390\" height=\"270\"\u003e\n\n\u003c/a\u003e \n\n### 🚀 Getting Started\n#### 📚 Knowledge \u0026 Skills Required \n- Python programming, Web Scraping \n- ML/DL fundamentals, Transformers, Hugging Face Hub\n- NLP tools like NLTK and spaCy\n- LLM knowledge for future chatbot development\n\n#### 💻 Software Requirements\n- IDE (VS Code) or jupyter notebook or google colab\n- Python 3, html, css\n  \n#### 🛡️ Tech Stack\n- Language: python, html, css\n- Web Scraping: scrapy, beautifulsoup4\n- NLP/ML/LLM: transformers, huggingface_hub, nltk, spacy, sklearn, pandas, numpy, networkx, pyvis\n- Deep Learning: pytorch, transformers-models (en_core_web_trf \u0026 facebook/bart-large-mnli) \n- Visualization: matplotlib, seaborn, pyvis.network\n- UI/ML-app: gradio\n\n\n#### 🔍 Modules Breakdown\n##### 📥 Dataset Collection\n- Subtitle Dataset: Main content used for theme classification and character network.\n- Transcript Dataset: Maps dialogues to speakers, crucial for chatbot.\n- Classification Dataset: Scraped from Naruto Fandom Wiki for training an attack classifier: ninjutsu, genjutsu, and taijutsu.\n. Tools used: scrapy, bs4\n\n##### 🎭 Theme Classifier\n- Model: facebook/bart-large-mnli (Zero-Shot)\n- Input: Subtitle data + custom themes (e.g., friendship, battle, sacrifice)\n- Output: CSV showing theme percentages across the series\n\n##### 🧑‍🤝‍🧑 Character Network\n- NER Model: en_core_web_trf via spaCy\n- Generate interactive network graph using networkx + pyvis\n\n##### 📊 Evaluation\n- Furtue work\n\n#### ⚙️ Installation\n```\ngit clone https://github.com/pointer2Alvee/llm-tv-series-analysis.git\ncd tv-series-analyzer\n\n# Recommended: Use a virtual environment\npip install -r requirements.txt\n```\n\n##### 🖇️ requirements.txt (core packages):\n```\nscrapy\nbeautifulsoup4\ntransformers==4.44.0\nhuggingface_hub==0.24.5\nnltk==3.8.1\ngradio\npyvis\nspacy\ntorch\npandas\nnumpy\nnetworkx\nseaborn\nmatplotlib\n```\n\n##### 💻 Running the App Locally\n1. Open Repo in VS code\n2. Run Command :  ``` python gradio_app.py ```\n3. Wait.. \n4. Open Local Host link in Browser\n\nFor Theme-Classifier :-\n- provide themes in text field: ```friendship, battle, sacrifice, love, dialogue```\n- Provide Subtitle Path : ```data\\Subtitles```\n- Provide output Save path : ```stubs\\theme_classifier_output.csv```\n- Click \"Get Themes\" Button\n\nFor Character-Network :-\n- Provide Subtitle Path : ```data\\Subtitles```\n- Provide output Save path : ```stubs\\ner_output.csv```\n- Click \"Get Character Network\" Button\n\n- On Colab? Use the global URL printed after running this to open the UI in your browser.\n\n#### 📖 Usage\n- Open VS Code and run the a bove commands\n\n### 🧪 Sample Topics Implemented\n- ✅ Web Scraping\n- ✅ BERT model \u0026 NER model\n- ✅ Theme Classifier, Character Relationship Network\n  \n- ⏳ Upcoming  : Chatbot, Text Classifier\n\n### 🧭 Roadmap\n- [x] Full attack classifier with fine-tuned DistilBERT\n- [ ] Fully interactive character chatbot (LLaMA-based)\n- [ ] Support for other anime/TV series via config\n\n### 🤝 Contributing\nContributions are welcomed!\n1. Fork the repo. \n2. Create a branch: ```git checkout -b feature/YourFeature```\n3. Commit changes: ```git commit -m 'Add some feature'```\n4. Push to branch: ```git push origin feature/YourFeature```\n5. Open a Pull Request.\n\n### 📜License\nDistributed under the MIT License. See LICENSE.txt for more information.\n\n### 🙏Acknowledgements\n- Special thanks to the open-source community / youtube for tools and resources.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointer2alvee%2Fllm-tv-series-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpointer2alvee%2Fllm-tv-series-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointer2alvee%2Fllm-tv-series-analysis/lists"}