Giter VIP home page Giter VIP logo

gnns-for-nlp's Introduction

Graph Neural Networks for Natural Language Processing

Conference Conference Slides

The repository contains code examples for GNN-for-NLP tutorial at EMNLP 2019 and CODS-COMAD 2020.

Slides can be downloaded from here.

Dependencies

  • Compatible with PyTorch 1.x, TensorFlow 1.x and Python 3.x.
  • Dependencies can be installed using requirements.txt.

TensorFlow Examples:

  • tf_gcn.py contains simplified implementation of first-order approximation of GCN model proposed by Kipf et. al. (2016)
  • Extensions of the same implementation for different problems:

PyTorch Examples:

  • pytorch_gcn.py is pytorch equivalent of tf_gcn.py implemented using pytorch-geometric.
  • Several other examples are available here.

Additional Resources:

Citation:

@inproceedings{vashishth-etal-2019-graph,
    title = "Graph-based Deep Learning in Natural Language Processing",
    author = "Vashishth, Shikhar  and
      Yadati, Naganand  and
      Talukdar, Partha",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP): Tutorial Abstracts",
    month = nov,
    year = "2019",
    address = "Hong Kong, China",
    publisher = "Association for Computational Linguistics",
    abstract = "This tutorial aims to introduce recent advances in graph-based deep learning techniques such as Graph Convolutional Networks (GCNs) for Natural Language Processing (NLP). It provides a brief introduction to deep learning methods on non-Euclidean domains such as graphs and justifies their relevance in NLP. It then covers recent advances in applying graph-based deep learning methods for various NLP tasks, such as semantic role labeling, machine translation, relationship extraction, and many more.",
}

gnns-for-nlp's People

Contributors

svjan5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gnns-for-nlp's Issues

RuntimeError: "sum_cuda" not implemented for 'Bool'

ubuntu@f6b86bb5112d:~/GNNs-for-NLP$ python pytorch_gcn.py
2019-11-19 11:50:03,447 - [INFO] - {'data': 'cora', 'gpu': '0', 'name': 'test_19_11_2019_11:50:03', 'lr': 0.01, 'max_epochs':200, 'l2': 0.0005, 'seed': 1234, 'opt': 'adam', 'gcn_dim': 16, 'dropout': 0.5, 'restore': False, 'log_dir': './log/', 'config_dir': './config/', 'model_dir': './models/', 'save_dir': './models//test_19_11_2019_11:50:03'}
{'config_dir': './config/',
 'data': 'cora',
 'dropout': 0.5,
 'gcn_dim': 16,
 'gpu': '0',
 'l2': 0.0005,
 'log_dir': './log/',
 'lr': 0.01,
 'max_epochs': 200,
 'model_dir': './models/',
 'name': 'test_19_11_2019_11:50:03',
 'opt': 'adam',
 'restore': False,
 'save_dir': './models//test_19_11_2019_11:50:03',
 'seed': 1234}
loading data
Traceback (most recent call last):
  File "pytorch_gcn.py", line 248, in <module>
    model.fit()
  File "pytorch_gcn.py", line 208, in fit
    train_loss = self.run_epoch(epoch)
  File "pytorch_gcn.py", line 175, in run_epoch
    train_acc   = self.get_acc(logits[self.data.train_mask], self.data.y, self.data.train_mask)
  File "pytorch_gcn.py", line 122, in get_acc
    return y_pred.eq(y_actual[mask]).sum().item() / mask.sum().item()
RuntimeError: "sum_cuda" not implemented for 'Bool'

python3.6
pytorch1.1
Is the pytorch version lower?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.