Knowledge Graph Construction from Unstructured Text
Advanced · 60 minutes · 100 points
In this advanced lab, you will build a knowledge graph from unstructured text using Python. You will extract named entities and relationships using spaCy and NetworkX, persist the graph to disk, query it programmatically, and export it in standard formats. By the end, you will have a working pipeline that transforms raw text into a queryable, structured knowledge graph.
What you’ll learn
- Extract named entities and co-occurrence relationships from raw text using spaCy
- Build and persist a knowledge graph using NetworkX with typed nodes and edges
- Query the knowledge graph to find entity relationships and shortest paths
- Export the knowledge graph to RDF Turtle format using rdflib for interoperability
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: python:3.12-slim
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
Topics: knowledge-graph, nlp, spacy, networkx, rdflib, entity-extraction, graph-analysis, rdf, turtle, python
Create a free account to start this lab.
Keep going
- Retrieval-Augmented Generation (RAG) with Chroma & LangChain
- Fine-Tuning LLMs with LoRA & QLoRA
- LLM Deployment & Serving with vLLM
- Agentic Workflows with LangGraph Advanced Patterns
- LLM Guardrails & Content Filtering Implementation
- Resilient Long-Running AI Tasks with Celery, Redis, and Container Fault Tolerance