Skip to content

trieunus/graph4nlp_demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Learning on Graphs for Natural Language Processing Demo

The repository contains code examples for DLG4NLP tutorials at NAACL 2021, SIGIR 2021, KDD 2021 and IJCAI 2021.

Slides can be downloaded from NAACL 2021 version, SIGIR 2021 version and KDD 2021 version.

Get Started

You will need to install our graph4nlp library in order to run the demo code. Please follow the following environment setup instructions. Please also refer to the graph4nlp repository page for more details on how to use the library.

Environment setup

  1. Create virtual environment
conda create --name graph4nlp python=3.7
conda activate graph4nlp
  1. Install graph4nlp library
  • Clone the github repo
git clone -b stable_202108 https://github.com/graph4ai/graph4nlp.git
cd graph4nlp

Please use stable instead of stable_202108 if you want to run the NAACL 2021 or SIGIR 2021 demos.

  • Then run ./configure (or ./configure.bat if you are using Windows 10) to config your installation. The configuration program will ask you to specify your CUDA version. If you do not have a GPU, please choose 'cpu'.
./configure
  • Finally, install the package
python setup.py install
  1. Install other packages
pip install torchtext
pip install notebook
  1. Set up StanfordCoreNLP (for static graph construction only, unnecessary for this demo because preprocessed data is provided)
java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000

Start Jupyter notebook and run the demo

After complete the above steps, you can start the jupyter notebook server to run the demo:

cd graph4nlp_demo/XYZ
jupyter notebook

Note that you will need to change XYZ to the specific folder name.

Additional Resources:

About

This repo is to present various code demos on how to use our Graph4NLP library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 75.7%
  • Python 24.3%