Make Texts More Knowledgeable
CogKTR is a knowledge enhanced text representation toolkit for natural language understanding.
According to our proposed Unified Knowledge-Enhanced Paradigm (UniKEP), CogKTR consists of four key stages, including knowledge acquisition, knowledge representation, knowledge injection, and knowledge application. CogKTR currently supports easy-to-use knowledge acquisition interfaces, multi-source knowledge embeddings, diverse knowledge-enhanced models, and various knowledge-intensive NLU tasks.Get Started
CogKTR is designed and built on our Unified Knowledge-Enhanced Paradigm, which consists of four stages: knowledge acquisition, knowledge representation, knowledge injection, and knowledge application.
CogKTR integrates multiple knowledge sources, including Wikidata, Wikipedia, WordNet and ConceptNet, and implements many knowledge enhanced methods based on this knowledge.
CogKTR modularizes our proposed paradigm and consists of Enhancer, Model, Core and Data modules, each of which is highly extensible so that researchers can implement new components easily.
BaseModel class is the base class of all models in CogKGE. BaseModel class organizes code into three basic sections: (1) forward function for training, (2) embedding function for getting the embedding of entities and relations, (3) scoring function for computing the score of triples. Model module consists of four parts: translation distance models, semantic matching models, graph neural network-based models and transformer-based models. We summarize the models in the following table:
|identify entity mention spans
|identify concept mention spans
|identify candidate texts spans
|tag sentences and get semantics labeling
|parse sentences and get dependency trees
|link entities to Wikipedia
|link concepts to ConceptNet
|link candidate texts to WordNet
|query entity titles and text descriptions in Wikipedia
|look up triples and subgraphs in Wikidata
|search subgraphs and relation paths in ConceptNet
|synonyms, example sentences, definitions and hypernyms
|convert Wikidata into continuous knowledge
|convert ConceptNet into continuous knowledge
|convert WordNet into continuous knowledge