Skip to content

saipranavr/knowledge-graph-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Knowledge Graph Generator

Transform unstructured text into interactive knowledge graphs using AI. Extract entities, relationships, and visualize complex information networks.

Python Neo4j spaCy

✨ Features

  • πŸ” Entity Extraction: Identify people, organizations, locations, concepts
  • πŸ”— Relationship Detection: Discover connections between entities
  • πŸ“Š Interactive Visualization: D3.js-powered graph visualization
  • πŸ—„οΈ Graph Database: Neo4j backend for complex queries
  • 🎯 Smart Filtering: Filter by entity type, relationship strength
  • πŸ“ˆ Analytics: Network analysis, centrality measures
  • 🌐 Web Interface: Explore graphs interactively
  • πŸ“€ Export: JSON, GraphML, CSV formats

πŸš€ Quick Start

# Install dependencies
pip install -r requirements.txt
python -m spacy download en_core_web_lg

# Start Neo4j (via Docker)
docker run -p 7474:7474 -p 7687:7687 neo4j:latest

# Run application
python src/main.py

# Process text
python src/cli.py --text "Your text here" --output graph.json

πŸ“– Usage

from knowledge_graph import KnowledgeGraphGenerator

kg = KnowledgeGraphGenerator()

# Generate from text
text = "Apple Inc. was founded by Steve Jobs in Cupertino."
graph = kg.generate(text)

# Visualize
kg.visualize(graph, output="graph.html")

# Query
results = kg.query("Who founded Apple?")

πŸ› οΈ Technical Stack

  • NLP: spaCy, NLTK
  • LLM: GPT-4 for relationship extraction
  • Graph DB: Neo4j
  • Visualization: D3.js, Pyvis
  • Backend: FastAPI
  • Frontend: React + D3

πŸ“Š Example Output

{
  "entities": [
    {"id": "1", "name": "Apple Inc.", "type": "ORGANIZATION"},
    {"id": "2", "name": "Steve Jobs", "type": "PERSON"},
    {"id": "3", "name": "Cupertino", "type": "LOCATION"}
  ],
  "relationships": [
    {"from": "2", "to": "1", "type": "FOUNDED", "strength": 0.95},
    {"from": "1", "to": "3", "type": "LOCATED_IN", "strength": 0.88}
  ]
}

🎯 Use Cases

  • Research: Analyze academic papers
  • Business: Extract insights from reports
  • Legal: Map case relationships
  • Journalism: Investigate connections

πŸ“„ License

MIT License


Visualize Connections β€’ Discover Insights β€’ Powered by AI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages