Skip to content

Commit

Permalink
Update quickstart doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgrek committed May 6, 2019
1 parent 8b01c4e commit ba2a87f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ kb = KB()
kb.store('eats(tom, rice)')
for ans in kb.query('eats(tom, Food)'):
print(ans['Food']) # prints 'rice'
...
# The included assets/countries.csv contains triples like:
# (paris, capital_of, france)
# (djibouti, in_region, africa)
# (denmark, borders, germany)
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('egypt', 'borders', 'sudan')
0.8467
```

# Requirements
Expand Down Expand Up @@ -54,12 +66,13 @@ From docs/ dir: `make html`. If something changed a lot: `sphinx-apidoc -o . ..`
* refactor the .attr method to be prolog style ie owns_a_raincoat(tom)
* to_csv method
* utilize postgres as backend triple store
* attributes for nodes / relations
* The to_csv/from_csv methods do not yet support node attributes.
* Add relation extraction from arbitrary unstructured text

# References & Acknowledgements

[Theo Trouillon. Complex-Valued Embedding Models for Knowledge Graphs. Machine Learning[cs.LG]. Université Grenoble Alpes, 2017. English. ffNNT : 2017GREAM048](https://tel.archives-ouvertes.fr/tel-01692327/file/TROUILLON_2017_archivage.pdf)

[L334: Computational Syntax and Semantics -- Introduction to Prolog, Steve Harlow](http://www-users.york.ac.uk/~sjh1/courses/L334css/complete/complete2li1.html)

[Open Book Project: Prolog in Python, Chris Meyers](http://www.openbookproject.net/py4fun/prolog/intro.html)
Expand Down

0 comments on commit ba2a87f

Please sign in to comment.