Skip to content

Commit ba2a87f

Browse files
committed
Update quickstart doc
1 parent 8b01c4e commit ba2a87f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ kb = KB()
1818
kb.store('eats(tom, rice)')
1919
for ans in kb.query('eats(tom, Food)'):
2020
print(ans['Food']) # prints 'rice'
21+
22+
...
23+
# The included assets/countries.csv contains triples like:
24+
# (paris, capital_of, france)
25+
# (djibouti, in_region, africa)
26+
# (denmark, borders, germany)
27+
28+
kb.from_csv('./assets/countries.csv')
29+
kb.build_kg_model(cuda=False, embedding_size=40)
30+
kb.train_kg_model(steps=2000, batch_size=1, verbose=False)
31+
kb.estimate_triple_prob('egypt', 'borders', 'sudan')
32+
0.8467
2133
```
2234

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

6172
# References & Acknowledgements
6273

74+
[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)
75+
6376
[L334: Computational Syntax and Semantics -- Introduction to Prolog, Steve Harlow](http://www-users.york.ac.uk/~sjh1/courses/L334css/complete/complete2li1.html)
6477

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

0 commit comments

Comments
 (0)