Knowledge Graph + NLP
Graph-Based Movie Chatbot
Overview
Built an intelligent QA chatbot capable of answering natural language questions about movies, actors, directors, and genres by querying a movie knowledge graph. The system also provides personalized movie recommendations based on user preferences.
System Architecture
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β User Question ββββββΆβ NER & Entity ββββββΆβ Query Builder β
β β β Linking β β β
βββββββββββββββββββ ββββββββββββββββββββ ββββββββββ¬βββββββββ
β β
β BERT + Fuzzy β
β Matching βΌ
β βββββββββββββββββ
β β Hybrid β
β β Execution β
β βββββββββ¬ββββββββ
β β
βββββββΌββββββ ββββββββΌβββββββ
β LLM NER β β SPARQL β
β Fallback β β + kNN β
βββββββββββββ ββββββββ¬βββββββ
β
βΌ
βββββββββββββββββ
β Answer β
β Generation β
βββββββββββββββββ
Key Features
- Entity Recognition & Linking: Combined BERT-based NER with fuzzy string matching to accurately identify and link movie entities, actor names, and genres from user queries.
- LLM Fallback: Integrated LLM-based NER for handling complex or ambiguous queries where traditional methods fail.
- Hybrid Query Execution: Implemented both SPARQL queries for structured retrieval and embedding-based vector search for semantic similarity matching.
- Smart Recommendations: Designed a hybrid recommendation approach combining graph-based feature overlap (shared actors, directors, genres) with embedding-based kNN retrieval for diverse suggestions.
Example Queries
- "Who directed Inception?"
- "What movies has Leonardo DiCaprio acted in?"
- "Recommend me movies similar to The Dark Knight"
- "List all sci-fi movies from 2020"
- "What's the rating of Parasite?"
Tech Stack
Python
SPARQL
BERT
LLM
RDF
FAISS
FuzzyWuzzy
Neo4j