项目作者: mommi84

项目描述 :
❇️ Markov Logic Networks for the Discovery of Links.
高级语言: Java
项目地址: git://github.com/mommi84/Mandolin.git
创建时间: 2014-04-14T16:50:39Z
项目社区:https://github.com/mommi84/Mandolin

开源协议:GNU General Public License v2.0

下载


logo

MANDOLIN

Markov Logic Networks for the Discovery of Links.

Requirements

  • Java 1.8+
  • PostgreSQL 9.4.x
  • Gurobi solver
  • Maven
  • Wget, Unzip

Quick start

Experiments

The following command will discover new links of any predicate (--aim) on the WordNet dataset (--input) with mining threshold 0.8 (--mining) and 1 million Gibbs sampling iterations (--sampling).

  1. java -Xmx1g -jar target/Mandolin-0.4.0-jar-with-dependencies.jar plain --input data/benchmark/wn18/wordnet-mlj12-train.nt,data/benchmark/wn18/wordnet-mlj12-valid.nt --output eval/wn18 --mining 0.8 --sampling 1000000 --aim "*"

Discovered links can be found in the --output folder at ./eval/wn18/discovered_X.nt, where X is the output threshold, meaning that a file contains all links whose confidence is greater or equal than X.

An excerpt of the discovered rules and weights:

  1. 0.990517419 wn18:_part_of(b, a) => wn18:_has_part(a, b)
  2. 0.862068966 wn18:_instance_hypernym(a, c) AND wn18:_synset_domain_topic_of(f, b) => wn18:_synset_domain_topic_of(a, b)

An excerpt of the discovered links with confidence > 0.9:

  1. wn18:08131530 wn18:_has_part wn18:08132046 .
  2. wn18:09189411 wn18:_has_part wn18:08707917 .
  3. wn18:10484858 wn18:_synset_domain_topic_of wn18:08441203 .
  4. wn18:01941987 wn18:_synset_domain_topic_of wn18:00300441 .

Basic documentation

Mandolin can be launched as follows.

  1. java -Xmx1g -jar target/Mandolin-0.4.0-jar-with-dependencies.jar <GOAL> <PARAMETERS>

Goals

Goal Description
plain Launch a plain Mandolin execution.
eval Evaluate MRR and hits@k.

Plain execution

Parameters for plain goal:

Parameter Description Example value
--input Comma-separated N-Triple files. data1.nt,data2.nt
--output Workspace and output folder. eval/experiment1
--aim Aim predicate. For all predicates use wildcard *. http://www.w3.org/2002/07/owl#sameAs
--mining Rule mining threshold. 0.9 (default: 0.0 support)
--sampling Gibbs sampling iterations. 1000000 (default: 100 x evidence size)
--rules Maximum number of rules. 1500 (default: none)
--sim Enable similarity among literals as min,step,max. 0.8,0.1,0.9 (default: none)
--onto Enable ontology import. true (default: false)
--fwc Enable forward-chain. true (default: false)

Evaluation

The eval goal takes two parameters: the N-Triples file of the test set and Mandolin’s output directory.

Example run:

  1. java -Xmx1g -jar target/Mandolin-0.4.0-jar-with-dependencies.jar eval data/benchmark/wn18/wordnet-mlj12-test.nt eval/wn18

Manual install

  • Clone project:
  1. git clone https://github.com/mommi84/Mandolin.git
  2. cd Mandolin

Alternative 1

  • Launch bash install.sh -c

Alternative 2

  • Insert PostgreSQL setting parameters into a file ./mandolin.properties. Example:
  1. # GENERAL CONFIGURATION FOR MANDOLIN
  2. pgsql_home=/usr/local/Cellar/postgresql/9.4.1
  3. pgsql_username=tom
  4. pgsql_password=
  5. pgsql_url=localhost
  • Download data

  • Compile project:

  1. export MAVEN_OPTS=-Xss4m
  2. mvn clean compile assembly:single

Database handler

After using Mandolin, stop the DB instance with:

  1. sh pgsql-stop.sh

The instance can be restarted with:

  1. sh pgsql-start.sh

License(s)

Mandolin is licensed under GNU General Public License v2.0.
AMIE is licensed under Creative Commons Attribution-NonComercial license v3.0.
ProbKB is licensed under the BSD license.
RockIt is licensed under the MIT License.
Gurobi can be activated using a free academic license.