Building graphs from text



I know that the Transformer and TreeLSTM examples already provide examples for working with text data, but I was wondering if there were other examples/tutorials from which I can learn more about working with graph-based representations of text data, particularly using dgl.

I’d appreciate it if people could share some relevant resources or their own implementations. Thank you!


It depends on what kind of data/what kind of graph you would like to see, we will release code of a new transformer structure on language model / natural language inference / text classification soon.
If needed we are glad to provide a unified “graph on text” interface, would like to provide some paper links of models you are interested?


Hi! A unified graph on text interface would be great.
I think there has been/will be growing interest in graph networks for NLP.

These are some examples I’ve come across:
GCN for text classification:
Classifying relations in clinical narratives with GCRNs:
Matching long text documents via GCN:
Cross-lingual knowledge graph alignment via GCN:
Graph convolution over pruned dependency trees improves relation extraction:

and there are many more. It would be really great to have useful interfaces for implementing graph convolution on text graphs (knowledge graphs, dependency parses, etc).


Cool, we are actually interested in using GNN to handle long text document/knowledge graphs, thanks for your help.
For knowledge graph, a new heterogeneous graph API is in progress, please stay tuned.
For syntax trees/documents, we would start doing that next month, and we will invite you to join discussion.

(a shameless plug, here is one of our early attempts in modeling long text with graph, the code is also available, I hope this helps)


Thank you so much!!
I’m definitely looking forward to the updates :slight_smile: