All Projects → davidlvxin → TransC

davidlvxin / TransC

Licence: other
Source code and datasets of EMNLP2018 paper: "Differentiating Concepts and Instances for Knowledge Graph Embedding".

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to TransC

BiLSTM-and-CNN-for-Link-Prediction
Keras implementation of path-based link prediction model for knowledge graph completion
Stars: ✭ 17 (-77.33%)
Mutual labels:  knowledge-graph, knowledge-graph-embeddings
R-MeN
Transformer-based Memory Networks for Knowledge Graph Embeddings (ACL 2020) (Pytorch and Tensorflow)
Stars: ✭ 74 (-1.33%)
Mutual labels:  knowledge-graph, knowledge-graph-embeddings
Ampligraph
Python library for Representation Learning on Knowledge Graphs https://docs.ampligraph.org
Stars: ✭ 1,662 (+2116%)
Mutual labels:  knowledge-graph, knowledge-graph-embeddings
Knowledge Graph Wander
A collection of papers, codes, projects, tutorials ... for Knowledge Graph and other NLP methods
Stars: ✭ 26 (-65.33%)
Mutual labels:  knowledge-graph, knowledge-graph-embeddings
NBFNet
Official implementation of Neural Bellman-Ford Networks (NeurIPS 2021)
Stars: ✭ 106 (+41.33%)
Mutual labels:  knowledge-graph
ChineseTextAnalysisResouce
中文文本分析相关资源汇总
Stars: ✭ 71 (-5.33%)
Mutual labels:  knowledge-graph
semantic-python-overview
(subjective) overview of projects which are related both to python and semantic technologies (RDF, OWL, Reasoning, ...)
Stars: ✭ 406 (+441.33%)
Mutual labels:  knowledge-graph
neno
NENO is a note-taking app that helps you create your personal knowledge graph.
Stars: ✭ 65 (-13.33%)
Mutual labels:  knowledge-graph
PaperMachete
A project that uses Binary Ninja and GRAKN.AI to perform static analysis on binary files with the goal of identifying bugs in software.
Stars: ✭ 49 (-34.67%)
Mutual labels:  knowledge-graph
KG4Rec
Knowledge-aware recommendation papers.
Stars: ✭ 76 (+1.33%)
Mutual labels:  knowledge-graph
CoLAKE
COLING'2020: CoLAKE: Contextualized Language and Knowledge Embedding
Stars: ✭ 86 (+14.67%)
Mutual labels:  knowledge-graph
kglib
TypeDB-ML is the Machine Learning integrations library for TypeDB
Stars: ✭ 523 (+597.33%)
Mutual labels:  knowledge-graph
cognipy
In-memory Graph Database and Knowledge Graph with Natural Language Interface, compatible with Pandas
Stars: ✭ 31 (-58.67%)
Mutual labels:  knowledge-graph
InteractE
AAAI 2020 - InteractE: Improving Convolution-based Knowledge Graph Embeddings by Increasing Feature Interactions
Stars: ✭ 69 (-8%)
Mutual labels:  knowledge-graph-embeddings
WSDM2021 NSM
Improving Multi-hop Knowledge Base Question Answering by Learning Intermediate Supervision Signals. WSDM 2021.
Stars: ✭ 84 (+12%)
Mutual labels:  knowledge-graph
Social-Knowledge-Graph-Papers
A paper list of research about social knowledge graph
Stars: ✭ 27 (-64%)
Mutual labels:  knowledge-graph
GGNN Reasoning
PyTorch implementation for Graph Gated Neural Network (for Knowledge Graphs)
Stars: ✭ 34 (-54.67%)
Mutual labels:  knowledge-graph
typedb
TypeDB: a strongly-typed database
Stars: ✭ 3,152 (+4102.67%)
Mutual labels:  knowledge-graph
Shukongdashi
使用知识图谱,自然语言处理,卷积神经网络等技术,基于python语言,设计了一个数控领域故障诊断专家系统
Stars: ✭ 109 (+45.33%)
Mutual labels:  knowledge-graph
skipchunk
Extracts a latent knowledge graph from text and index/query it in elasticsearch or solr
Stars: ✭ 18 (-76%)
Mutual labels:  knowledge-graph

Differentiating Concepts and Instances for Knowledge Graph Embedding

Source code and datasets of EMNLP2018 paper: "Differentiating Concepts and Instances for Knowledge Graph Embedding". https://arxiv.org/abs/1811.04588

News

Thanks to Shengding Hu for providing the PyTorch version of the training code.

Dataset

We provide YAGO39K and M-YAGO39K dataset we used in this work in data/YAGO39K directory. The meanings of these files are explained as follows:

data/YAGO39K/Train

  • instance2id.txt, concept2id.txt, relation2id.txt: the id of every instance, concept and relation in this dataset.
  • triple2id.txt: normal triples represented as ids with format [head_instance_id tail_instance_id relation_id].
  • instanceOf2id.txt: instanceOf triples represented as ids with format [instance_id concept_id].
  • subClassOf2id.txt: subClassOf triples represented as ids with format [sub_concept_id concept_id].

data/YAGO39K/Valid

  • triple2id_positive.txt, instanceOf2id_positive.txt, subClassOf2id_positive.txt: positive triples from YAGO dataset. Their formats are the same as those in data/YAGO39K/Train.
  • triple2id_negative.txt, instanceOf2id_negative.txt, subClassOf2id_negative.txt: negative triples generated by us, which will be used in Triple Classification experiments.

data/YAGO39K/Test

  • the test dataset, which is similar to data/YAGO39K/Valid.

data/YAGO39K/M-Valid

  • the valid dataset for M-YAGO39K. The formats of all files are the same as those in data/YAGO39K/Valid.

data/YAGO39K/M-Test

  • the test dataset for M-YAGO39K. The formats of all files are the same as those in data/YAGO39K/Test.

Codes

The source codes of our work are put in the folder src/.

Compile

cd src
make

Train

cd src
./transC

You can add the following optional parameters when running transC:

  • -dim: the vector size.
  • -margin: the margin for normal triples.
  • -margin_ins: the margin for instanceOf triples.
  • -margin_sub: the margin for subClassOf triples.
  • -data: the dataset that you want to use. You can only choose YAGO39K in current vision.
  • -l1flag: it can be 1 or 0, 1 means using L1 loss and 0 means L2 loss.
  • -bern: it can be 1 or 0, 1 means using "bern" strategy and 0 means using "unif" strategy.

The Vectors of entities, concepts and relations will be stored in the folder vector/ after training.

Python Code

There is also python code for the training part, in py_version/ The python version can be run with

python -m py_version.transc

The outputs are stored in the same format and location with cpp version.

Experiment

Link Precidtion

For Link Prediction experiment, you need to

cd src
./test_link_prediction

You can add the following optional parameters when running test_link_prediction:

  • -dim: the vector size.
  • -data: the dataset that you want to use. You can only choose YAGO39K in current vision.
  • -threads: how many threads you want to use.

Normal Triple Classification

For normal Triple Classification experiment, you need to

cd src
./test_classification_normal

You can add the following optional parameters when running test_triple_classification_normal:

  • -dim: the vector size.
  • -data: the dataset that you want to use. You can only choose YAGO39K in current vision.

InstanceOf and SubClassOf Triple Classification

For instanceOf and subClassOf Triple Classification experiments, you need to

cd src
./test_classification_isA

You can add the following optional parameters when running test_triple_classification_isA:

  • -dim: the vector size.
  • -data: the dataset that you want to use. You can only choose YAGO39K in current vision.
  • -mix: it can be 1 or 0, 1 means doing this experiment in M-YAGO39K and 0 means doing this experiment in YAGO39K.

Cite

If you use the code, please cite this paper:

Xin Lv, Lei Hou, Juanzi Li, Zhiyuan Liu. Differentiating Concepts and Instances for Knowledge Graph Embedding. *The Conference on Empirical Methods in Natural Language Processing (EMNLP 2018)*L.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].