All Projects → tomgrek → Zincbase

tomgrek / Zincbase

Licence: mit
A batteries-included kit for knowledge graphs

Programming Languages

python
139335 projects - #7 most used programming language
prolog
421 projects

Projects that are alternatives of or similar to Zincbase

Grakn
TypeDB: a strongly-typed database
Stars: ✭ 2,947 (+1083.53%)
Mutual labels:  knowledge-graph, knowledge-base
Workbase
Grakn Workbase (Knowledge IDE)
Stars: ✭ 106 (-57.43%)
Mutual labels:  knowledge-graph, knowledge-base
Awesome Knowledge Management
A curated list of amazingly awesome articles, people, applications, software libraries and projects related to the knowledge management space
Stars: ✭ 758 (+204.42%)
Mutual labels:  knowledge-graph, knowledge-base
Dynamic Kg
Dynamic (Temporal) Knowledge Graph Completion (Reasoning)
Stars: ✭ 381 (+53.01%)
Mutual labels:  knowledge-graph, knowledge-base
Tutorial Utilizing Kg
Resources for Tutorial on "Utilizing Knowledge Graphs in Text-centric Information Retrieval"
Stars: ✭ 148 (-40.56%)
Mutual labels:  knowledge-graph, knowledge-base
Athens
Free self-hosted desktop app: https://github.com/athensresearch/athens/releases; Try the demo at https://athensresearch.github.io/athens; Docs viewable at https://athensresearch.github.io/docs/
Stars: ✭ 5,501 (+2109.24%)
Mutual labels:  knowledge-graph, knowledge-base
Simple
SimplE Embedding for Link Prediction in Knowledge Graphs
Stars: ✭ 104 (-58.23%)
Mutual labels:  knowledge-graph, knowledge-base
typedb-loader
TypeDB Loader - Data Migration Tool for TypeDB
Stars: ✭ 43 (-82.73%)
Mutual labels:  knowledge-graph, knowledge-base
Zincbase
A state of the art knowledge base
Stars: ✭ 144 (-42.17%)
Mutual labels:  knowledge-graph, knowledge-base
Hyte
EMNLP 2018: HyTE: Hyperplane-based Temporally aware Knowledge Graph Embedding
Stars: ✭ 130 (-47.79%)
Mutual labels:  knowledge-graph, knowledge-base
Ccks2019 el
CCKS 2019 中文短文本实体链指比赛技术创新奖解决方案
Stars: ✭ 326 (+30.92%)
Mutual labels:  knowledge-graph, knowledge-base
Aser
ASER (activities, states, events, and their relations), a large-scale eventuality knowledge graph extracted from more than 11-billion-token unstructured textual data.
Stars: ✭ 171 (-31.33%)
Mutual labels:  knowledge-graph, knowledge-base
Logseq
A privacy-first, open-source platform for knowledge management and collaboration. Desktop app download link: https://github.com/logseq/logseq/releases, roadmap: https://trello.com/b/8txSM12G/roadmap
Stars: ✭ 8,210 (+3197.19%)
Mutual labels:  knowledge-base, knowledge-graph
Atomspace
The OpenCog (hyper-)graph database and graph rewriting system
Stars: ✭ 495 (+98.8%)
Mutual labels:  knowledge-graph, knowledge-base
Graphbrain
Language, Knowledge, Cognition
Stars: ✭ 294 (+18.07%)
Mutual labels:  knowledge-graph, knowledge-base
Stock Knowledge Graph
利用网络上公开的数据构建一个小型的证券知识图谱/知识库
Stars: ✭ 1,182 (+374.7%)
Mutual labels:  knowledge-graph, knowledge-base
typedb
TypeDB: a strongly-typed database
Stars: ✭ 3,152 (+1165.86%)
Mutual labels:  knowledge-graph, knowledge-base
awesome-ontology
A curated list of ontology things
Stars: ✭ 73 (-70.68%)
Mutual labels:  knowledge-graph, knowledge-base
Capse
A Capsule Network-based Embedding Model for Knowledge Graph Completion and Search Personalization (NAACL 2019)
Stars: ✭ 114 (-54.22%)
Mutual labels:  knowledge-graph, knowledge-base
Topic Db
TopicDB is a topic maps-based semantic graph store (using PostgreSQL for persistence)
Stars: ✭ 164 (-34.14%)
Mutual labels:  knowledge-graph, knowledge-base

CircleCI DOI Documentation Status

Hello!

The tech behind parts of ZincBase was acquired. This repo is still here for reference, but it is deprecated.

Fortunately, work still goes on. Apart from a couple of fringe bits, the active repo lives here.

The new owner of ZincBase as it is today is ComplexDB.

Alright, you still want to continue

Zincbase logo

ZincBase is a state of the art knowledge base. It does the following:

  • Extract facts (aka triples and rules) from unstructured data/text
  • Store and retrieve those facts efficiently
  • Build them into a graph
  • Provide ways to query the graph, including via bleeding-edge graph neural networks.

Zincbase exists to answer questions like "what is the probability that Tom likes LARPing", or "who likes LARPing", or "classify people into LARPers vs normies":

Example graph for reasoning

It combines the latest in neural networks with symbolic logic (think expert systems and prolog) and graph search.

View full documentation here.

Quickstart

from zincbase import KB
kb = KB()
kb.store('eats(tom, rice)')
for ans in kb.query('eats(tom, Food)'):
    print(ans['Food']) # prints 'rice'

...
# The included assets/countries_s1_train.csv contains triples like:
# (namibia, locatedin, africa)
# (lithuania, neighbor, poland)

kb = KB()
kb.from_csv('./assets/countries.csv')
kb.build_kg_model(cuda=False, embedding_size=40)
kb.train_kg_model(steps=2000, batch_size=1, verbose=False)
kb.estimate_triple_prob('fiji', 'locatedin', 'melanesia')
0.8467

Requirements

  • Python 3
  • Libraries from requirements.txt
  • GPU preferable for large graphs but not required

Installation

pip install -r requirements.txt

Note: Requirements might differ for PyTorch depending on your system.

Testing

python test/test_main.py
python test/test_graph.py
python test/test_lists.py
python test/test_nn_basic.py
python test/test_nn.py
python test/test_neg_examples.py
python test/test_truthiness.py
python -m doctest zincbase/zincbase.py

Validation

"Countries" and "FB15k" datasets are included in this repo.

There is a script to evaluate that ZincBase gets at least as good performance on the Countries dataset as the original (2019) RotatE paper. From the repo's root directory:

python examples/eval_countries_s3.py

It tests the hardest Countries task and prints out the AUC ROC, which should be ~ 0.95 to match the paper. It takes about 30 minutes to run on a modern GPU.

There is also a script to evaluate performance on FB15k: python examples/fb15k_mrr.py.

Building documentation

From docs/ dir: make html. If something changed a lot: sphinx-apidoc -o . ..

TODO

  • Add documentation
  • to_csv method
  • utilize postgres as backend triple store
  • The to_csv/from_csv methods do not yet support node attributes.
  • Add relation extraction from arbitrary unstructured text
  • Add context to triple - that is interpreted by BERT/ULM/GPT-2 similar and put into an embedding that's concat'd to the KG embedding.
  • Reinforcement learning for graph traversal.

References & Acknowledgements

Theo Trouillon. Complex-Valued Embedding Models for Knowledge Graphs. Machine Learning[cs.LG]. Université Grenoble Alpes, 2017. English. ffNNT : 2017GREAM048

L334: Computational Syntax and Semantics -- Introduction to Prolog, Steve Harlow

Open Book Project: Prolog in Python, Chris Meyers

Prolog Interpreter in Javascript

RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space, Zhiqing Sun and Zhi-Hong Deng and Jian-Yun Nie and Jian Tang, International Conference on Learning Representations, 2019

Citing

If you use this software, please consider citing:

@software{zincbase,
  author = {{Tom Grek}},
  title = {ZincBase: A state of the art knowledge base},
  url = {https://github.com/tomgrek/zincbase},
  version = {0.1.1},
  date = {2019-05-12}
}

Contributing

See CONTRIBUTING. And please do!

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].