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:#
Building a Knowledge Base from Texts (https://www.nlplanet.org/course-practical-nlp/02-practical-nlp-first-tasks/16-knowledge-graph-from-text)
Construct a biomedical knowledge graph with NLP (https://towardsdatascience.com/construct-a-biomedical-knowledge-graph-with-nlp-1f25eddc54a0)
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