AnyBURL

AnyBURL

This is the home of the rule learner AnyBURL (Anytime Bottom Up Rule Learning). AnyBURL has been designed for the use case of knowledge base completion, however, it can also be applied to any other use case where rules are helpful. You can use it to (i) learn rules, (ii) apply them create candidate rankings, (iii) and to evaluate the created ranking.

NEWS: We are currently finalizing the new version of AnyBURL that is described in a submission to KR 2020.
The code and brief documentation will be available March 20th latest!

Alternative approaches to knowledge base completion, which are currently dominating the research field, are embedding a given graph into a low dimensional vector space. If you want to compare AnyBURL to these approaches we recommend the use of LibKGE.

Results

These are the results of the (not-yet-multithreaded) AnyBURL IJCAI 2019 version as reported in the IJCAI paper when learning 1000 seconds (~17 minutes learning) on a rather old laptop.

Dataset hits@1 hits@10
WN18 93.9 95.6
WN18RR 44.6 55.5
FB15 80.4 89.0
FB15-237 23.0 47.9
YAGO03-10 42.9 63.9

Download (and build) AnyBURL

The current version 2019-05 is more or less the same as the version we used for the IJCAI paper. However, the 2019-05 version is multithreaded. On a machine with 16 cores runtimes for rule learning and rule application should be around 10 times faster.

AnyBURL is packaged as jar file and requires no external resources. You can download the jar file here.

If you have problems in running the jar due to, e.g., some java version conflict, you can build an AnyBURL.jar on you own. If you want (or need) to do this continue as follows: Download the source code and unzip it. Compile the code and create the jar as follows. First create a folder build, then compile with the following command.

javac de/unima/ki/anyburl/*.java -d build

Package in a jar:

jar cfv AnyBURL-2019-05.jar -C build .

There is a dot . at the end of the line, its required. Afterwards you can delete the build folder.

Datasets

You can use AnyBURL on any dataset that comes as a set of triple. The supported format is rather simple and should look like this. The separator can be blank or tab.

anne loves bob
bob marriedTo charly
bob hasGender male
...

So far it has been tested on the well known datasets FB15k, FB15237, WN18, WN18RR and YAGO03-10. We have zipped the FB15, FB15-237, and WN18 in one file. Please download and unzip. YAGO03-10 and WN18RR is available at the ConvE webpage.

Run AnyBURL

AnyBURL can be used (i) to learn rules and (ii) to apply the learned rules to solve prediction tasks. These are two distinct processes that have to be started independently.

Learning

Download and open the file config-learn.properties and modify the line that directs to the training file choosing the datasets that you want to apply AnyBURL to. Create the output folder rules, then run AnyBURL with this command.

java -Xmx6G -cp AnyBURL-2019-05.jar de.unima.ki.anyburl.Learn config-learn.properties

It will create three files alpha-10, alpha-50, and alpha-100 in the rules folder. These files contain the rules learned after 10, 50, and 100 seconds. During executing AnyBURL you can see how many rules have been found so far and how the saturation rate for cyclic and acyclic rules changes over time. Note that everything should also work fine when setting the maximal heapsize to only 3G.

You can change the parameters in the file according to your needs. This table gives an overview on some of the parameters (together with their default values) that you can set in the config file.

Predicting

Download and open the file config-apply.properties and modify it according to your needs (if required). Create the output folder predictions, then run AnyBURL with this command. Note that you have to specify the rules that have been learned previously.

java -Xmx6G -cp AnyBURL-2019-05.jar de.unima.ki.anyburl.Apply config-apply.properties

This will create two files alpha-10, alpha-100 in the predictions folder. Each contains the top-k rankings for the completion tasks, which are already filtered rankings (this is the only reason why the validation and test set must be specified in the apply config files)

As for the learning phase, you can change the parameters in the file according to your needs. This table gives an overview on some of the parameters (together with their default values) that you can set in the config file.

Evaluating Results

To eval these results, use this command after modifying config-eval.properties (if required). The evaluation result is printed to standard out.

java -Xmx6G -cp AnyBURL-2019-05.jar de.unima.ki.anyburl.Eval config-eval.properties

This evaluation command line interface is only used for demonstration purpose, its not intended to be used in a large scale experimental setting.

Publications

The second paper is not about AnyBURL but about a simple rule-based baseline called RuleN and its comparison againts some state of the art embedding methods. The good results of RuleN motivated us to develop AnyBURL.

Previous Versions

12.06.2019: Some minor issues in the sources of the 2019-05 version have been fixed (thanks to the feedback of Andrea Rossi). Now there should be no built problems related to the encoding of German Umlaute in some comments (most of the comments are in English) and the reference to an outdated (and unused) package.

Contact

If you have any questions, feel free to write a mail at any time. We are also interested to hear about some applications where AnyBURL was useful.

 

 

Wikipedia: " A burl [...] is a tree growth in which the grain has grown in a deformed manner. It is commonly found in the form of a rounded outgrowth on a tree trunk or branch that is filled with small knots from dormant buds." If you cut it you get what is shown in the background. The small knots, which are also called burls, can be associated with constants and the regularities that are associated with the forms and structures that surround them.