Answer common sense questions using ConceptNet and PyTorch Geometric GNNs.
# Install dependencies
pip install torch torch-geometric
# Build graph from ConceptNet profiles
python build_graph.py
# Train GNN model
python train_gnn.py
# Ask questions
python main.pyQuestion: What is a dog?
Answer: A dog is a type of pet and mammal. It is loyal and friendly. Dogs can bark and run.
Question: Where do you find cats?
Answer: You can typically find a cat at home, house, or outside.
- Parse ConceptNet semantic profiles → nodes and edges
- Build PyTorch Geometric graph (988 nodes, 1.3k edges)
- Train 2-layer GCN on link prediction task
- Answer questions using learned embeddings + graph structure
parse_profile.py- Parse ConceptNet text filesbuild_graph.py- Build PyTorch Geometric graphtrain_gnn.py- GNN training and model managementmain.py- Question answering interface
ConceptNet Profiles → Graph → GCN → Embeddings → Q&A System
(988 nodes) (32-dim)
- Python 3.10+
- PyTorch 2.0+
- PyTorch Geometric
- ConceptNet semantic profile text files in
./conceptnet_profiles/
MIT