Harry Potter Character Galaxy is an immersive, AI-driven visualization platform that explores the intricate web of relationships in the wizarding world. By analyzing thousands of lines of character dialogues using state-of-the-art Natural Language Processing (NLP), the system maps characters into a dynamic 3D star-field where spatial distance represents semantic and emotional similarity.
"Words are, in my not-so-humble opinion, our most inexhaustible source of magic." — Albus Dumbledore
- 🌌 Interactive 3D Galaxy: Explore a living universe where characters are represented as glowing celestial nodes. Similar speaking styles and emotional arcs result in closer spatial proximity.
- 🧠 Advanced NLP Engine: Deep analysis of vocabulary usage, sentence structure, and dialogue patterns using Sentence Transformers and OpenAI/Groq Embeddings.
- 🎭 Emotion & Trait Mapping: Characters are profiled based on core traits such as Intelligence, Aggression, Loyalty, and Humor.
- 🔍 Real-Time Neural Search: Instantly locate any wizard or witch and see their nearest neighbors in the vector space.
- 🛡️ House-Based Clustering: Visual grouping of characters by Hogwarts Houses (Gryffindor, Slytherin, etc.) powered by AI-driven semantic similarity.
- React.js & Vite: Modern, high-performance web framework.
- Three.js / React Three Fiber: Immersive 3D graphics and animations.
- Tailwind CSS 4: Premium utility-first styling with a custom magical theme.
- Framer Motion: Cinematic UI transitions and micro-animations.
- FastAPI: Ultra-fast Python web framework for character intelligence.
- Scikit-learn: For dimensionality reduction (t-SNE/UMAP) and clustering.
- Sentence Transformers: To convert raw text into high-dimensional vectors.
- Vector DB Concept: Mapping character similarities in a spatial coordinate system.
mermaid graph TD A[Raw Character Dialogues] --> B[NLP Preprocessing] B --> C[Feature Extraction & Embeddings] C --> D[Similarity Matrix Computation] D --> E[Dimensionality Reduction - t-SNE] E --> F[3D Coordinate Mapping] F --> G[React Three Fiber Scene] G --> H[User Interface]
- Node.js (v18+)
- Python (v3.10+)
- Git
bash git clone https://github.com/khushalkks/Harry_Porter.git cd Harry_Porter
bash cd frontend npm install npm run dev
bash cd ../backend pip install -r requirements.txt python app/main.py
The project follows a rigorous NLP pipeline to ensure accuracy:
- Dialogue Aggregation: Consolidating dialogue from scripts and books.
- Neural Encoding: Converting text into 1536-dimensional vectors.
- Spatial Reduction: Using UMAP/t-SNE to squash 1536 dimensions into 3D coordinates.
- Visual Mapping: Rendering the final coordinates into a real-time interactive Three.js scene.
Developed with ⚡ and Magic for the Wizarding World.