Skip to content

encryptedtouhid/KnowledgeGraphVisualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knowledge Graph Builder

Build and visualize knowledge graphs from PDF documents using NLP. No external APIs required.

image

Quick Start

./run.sh          # macOS/Linux
# or
run.bat           # Windows

The system will:

  1. Extract text from PDFs in src/docs/
  2. Build a knowledge graph using NLP (SpaCy)
  3. Start server at http://localhost:8000

Features

  • Automatic Graph Building - Extracts entities and relationships from PDFs
  • Interactive Visualization - D3.js powered graph with zoom, pan, and drag
  • Dual Storage - JSON (default) or Neo4j for large-scale graphs
  • Auto-Rebuild - Fresh graph on every run

Installation

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Download NLP model
python -m spacy download en_core_web_sm

# Run
python src/main.py

Usage

Add Documents

Place PDFs in src/docs/ and run the system

View Graph

http://localhost:8000/visualize

API Endpoints

  • /api/graph - Graph data
  • /api/stats - Statistics
  • /docs - API documentation

Neo4j (Optional)

# Create .env file
cp .env.example .env

# Edit .env
USE_NEO4J=true
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-password

Tech Stack

  • NLP: SpaCy for entity extraction
  • Graph: NetworkX
  • Storage: JSON / Neo4j
  • API: FastAPI
  • Frontend: D3.js

Design

Follows SOLID, KISS, and YAGNI principles with clean separation of concerns.

About

Visualize Knowledge Graphs from PDF documents using NLP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published