graph4nlp  by graph4ai

SDK for graph neural networks in NLP

created 5 years ago
1,687 stars

Top 25.7% on sourcepulse

GitHubView on GitHub
Project Summary

Graph4NLP is a Python library designed to simplify the application of Graph Neural Networks (GNNs) to Natural Language Processing (NLP) tasks. It offers pre-implemented state-of-the-art models and flexible interfaces for researchers and developers, aiming to accelerate R&D in Deep Learning on Graphs for NLP.

How It Works

Graph4NLP is built on a four-layer architecture: Data, Module, Model, and Application. It leverages highly optimized runtime libraries like DGL for efficiency and extensibility. The library supports various graph construction methods and graph embedding techniques, enabling users to build custom GNN models for diverse NLP applications.

Quick Start & Requirements

  • Installation: pip install graph4nlp${CUDA} (e.g., pip install graph4nlp-cu102 for CUDA 10.2, pip install graph4nlp for CPU). Installation from source is also supported.
  • Prerequisites: PyTorch (>=1.6.0), torchtext (>=0.7.0). CUDA toolkit is required for GPU acceleration.
  • Resources: Requires Stanford CoreNLP for dependency graph construction.
  • Documentation: Graph4NLP Documentation

Highlighted Details

  • Supports end-to-end models like Graph2Seq and Graph2Tree.
  • Offers implementations for applications including Text Classification, Semantic Parsing, Machine Translation, Summarization, Knowledge Graph Completion, and more.
  • Provides performance benchmarks across various NLP tasks and datasets.
  • Features a modular design for extensibility and customization.

Maintenance & Community

The project is led by the Graph4AI Team, with contributors from industry and academia (e.g., Pinterest, Zhejiang University, Facebook AI, IBM). Recent releases include v0.5.5 (Jan 2022) with API improvements and refactoring. Resources include a DLG4NLP website and a survey paper.

Licensing & Compatibility

  • License: Apache License 2.0.
  • Compatibility: Permissive license suitable for commercial use and integration with closed-source projects.

Limitations & Caveats

Windows users are advised to refer to source code installation due to potential compatibility issues with pip wheels. CUDA 11.1 users also need to install from source.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
9 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.