NeuralGraphSum is a cutting-edge neural text summarization framework that leverages Graph Neural Networks (GNNs) to enhance traditional sequence-to-sequence models. This project implements and compares four distinct architectures for abstractive summarization, demonstrating how graph-based representations can significantly improve summary quality by capturing structural relationships within documents.
- 73.3% ROUGE-1 Score achieved with GNN+BART hybrid architecture
- 17.8% performance improvement over standalone BART models
- Comprehensive evaluation across 4 different neural architectures
- Advanced graph construction using semantic similarity and attention mechanisms
| Architecture | ROUGE-1 | ROUGE-2 | ROUGE-L | Improvement |
|---|---|---|---|---|
| BART (Baseline) | 38.20 | 17.50 | 27.00 | - |
| BiLSTM | 6.23 | 0.00 | 5.10 | -84% |
| GNN + BART | 73.35 | 63.78 | 57.39 | +92% |
| BiLSTM + GNN | 26.70 | 7.95 | 16.99 | -30% |
Results on CNN/DailyMail dataset (0.1% subset for computational efficiency)
- Fine-tuned BART-large on article-summary pairs
- Standard encoder-decoder architecture with attention
- Serves as performance benchmark
- Bidirectional LSTM encoder with attention-based decoder
- Custom implementation with teacher forcing
- Demonstrates traditional RNN approach limitations
- Graph Construction: Word and sentence nodes with semantic edges
- Edge Types: Word-sentence occurrence, sentence-sentence similarity
- GNN Processing: 3-layer GraphSAGE with 8 attention heads
- Integration: GNN-enhanced embeddings fed to fine-tuned BART
- GNN-based document encoding
- BiLSTM decoder for sequence generation
- Combines graph structural awareness with sequential generation
- Dataset: CNN/DailyMail (Abisee version)
- Total Articles: 287,113 (training set)
- Subset Used: 287 articles (0.1% for computational constraints)
- Domain: News articles with human-written summaries
Raw Text β Cleaning β Tokenization β Graph Construction β Embedding
- Text Cleaning: Special character removal, normalization
- Tokenization: NLTK sentence and word tokenization
- Graph Construction:
- Nodes: Individual words and sentences
- Edges: TF-IDF similarity (words), BERT cosine similarity (sentences)
- Features: GloVe 300D + BERT 768D embeddings
- Sequence Preparation: BART tokenization for transformer models
torch==2.0+
torch-geometric==2.4+
transformers==4.30+
datasets==2.14+
nltk==3.8+
rouge-score==0.1.2
numpy==1.24+
pandas==2.0+GNN Configuration:
- Layers: 3
- Hidden Size: 256
- Attention Heads: 8
- Dropout: 0.1
Training Setup:
- Batch Size: 1 (memory constraints)
- Epochs: 3-11 (model dependent)
- Optimizer: Adam (lr=1e-4)
- Device: GPU (T4/V100)- Structural Relationships: GNNs capture non-sequential word dependencies
- Long-range Dependencies: Graph connections bridge distant semantic concepts
- Attention Mechanism: Multi-head attention in GNN layers improves focus
- Best Performance: GNN+BART achieves highest ROUGE scores across all metrics
- Computational Trade-off: Graph processing adds overhead but significant quality gains
- Model Complexity: Hybrid approaches outperform individual architectures
- Embedding Choice: BERT embeddings crucial for semantic edge construction
- Graph Structure: Sentence-level connections more impactful than word-level
- Integration Strategy: Feature concatenation works better than late fusion
# Clone repository
git clone https://github.com/your-username/NeuralGraphSum.git
cd NeuralGraphSum
# Install dependencies
pip install -r requirements.txt
# Run GNN+BART model
python run_gnn_bart.py --config configs/gnn_bart.yamlfrom models import GNNBARTSummarizer
# Initialize model
model = GNNBARTSummarizer(
gnn_layers=3,
hidden_size=256,
attention_heads=8
)
# Train on your data
model.train(train_data, validation_data, epochs=3)
# Generate summaries
summary = model.generate_summary(article_text)NeuralGraphSum/
βββ models/ # Model implementations
β βββ gnn_models.py # Graph Neural Network architectures
β βββ bart_models.py # BART fine-tuning utilities
β βββ bilstm_models.py # BiLSTM implementations
βββ data/ # Dataset processing
β βββ preprocessing.py # Text cleaning and tokenization
β βββ graph_builder.py # Graph construction algorithms
βββ notebooks/ # Jupyter notebooks with experiments
β βββ GNN+Transformer.ipynb
β βββ Transformer.ipynb
β βββ bilstm.ipynb
β βββ GNN + BiLSTMs.ipynb
βββ evaluation/ # Evaluation metrics and scripts
βββ configs/ # Model configuration files
βββ Plots/ # Training curves and visualizations
βββ requirements.txt # Python dependencies
- ROUGE-1: Unigram overlap (content preservation)
- ROUGE-2: Bigram overlap (fluency assessment)
- ROUGE-L: Longest common subsequence (structural similarity)
- Test Set: 10 articles from CNN/DailyMail test split
- Generation: Beam search with length constraints
- Comparison: Human-written reference summaries
- Statistical Significance: Multiple runs with different seeds
- Larger Dataset: Scale to full CNN/DailyMail dataset
- Multi-document Summarization: Extend to document clusters
- Domain Adaptation: Test on scientific papers, legal documents
- Real-time Processing: Optimize for production deployment
- Multilingual Support: Extend to non-English languages
- Graph Attention Networks: Explore GAT vs GraphSAGE
- Dynamic Graphs: Adaptive graph construction during training
- Hierarchical GNNs: Multi-level document representation
- Cross-modal Integration: Include visual information for news articles
- BART: Lewis, M. et al. "BART: Denoising Sequence-to-Sequence Pre-training" (2019)
- GraphSAGE: Hamilton, W. et al. "Inductive Representation Learning on Large Graphs" (2017)
- CNN/DailyMail: Hermann, K. et al. "Teaching Machines to Read and Comprehend" (2015)
- ROUGE Metrics: Lin, C.-Y. "ROUGE: A Package for Automatic Evaluation of Summaries" (2004)
We welcome contributions! Please see our Contributing Guidelines for details.
# Fork and clone the repository
git clone https://github.com/your-fork/NeuralGraphSum.git
# Create development environment
conda create -n neuralgraphsum python=3.8
conda activate neuralgraphsum
pip install -r requirements-dev.txt
# Run tests
pytest tests/This project is licensed under the MIT License - see the LICENSE file for details.
- Hugging Face for BART model and datasets library
- PyTorch Geometric team for GNN implementations
- CNN/DailyMail dataset creators for benchmark data
- Research Community for foundational work in neural summarization
Built with β€οΈ by the NeuralGraphSum Team
For questions, issues, or collaboration opportunities, please open an issue or contact the maintainers.