knowledge graph, tutorial

Knowledge Graphs from Text#

Welcome#

Let’s go, let’s create some knowledge graphs from publications.

  • Nodes: ā€œentitiesā€ extracted with Named Entity Recognition (NER)

  • Edges: ā€œrelationsā€ extracted with Relation Classification (RC)

Things we need:

  • Publications, we can search for them on PubMed.

  • Visualisation tools.

Other tutorials I used:#

Tools:#

  • Text preprocessing: Natural Language Toolkit (NLTK)

  • Named entity recognition: BERN2, PubTator 3.0 with AIONER

  • Relation extractor: zero-shot relation extractor (zero_shot_re)

        graph LR
  A[NLTK] --> B[NER] 
  B --> C[Relation extractor]
    

Text preprocessing#

Tool: Natural Language Toolkit (NLTK)

Named entity recognition (NER)#

Servers:

  • BERN2

  • PubTator 3.0 with AIONER

Relation extractor#

I used the code for zero-shot relation extractor based on the paper Exploring the zero-shot limit of FewRel from fractalego/zero-shot-relation-extractor pip install didn’t work, so in the end I just copied the codes from extractor.py and model.py.

Model: fractalego/fewrel_zero_shot

Construct Knowledge Base (KB)#

Plot Knowledge Base (KB)#

References#