This program takes as input candidate facts, Knowledge Graph (KG), set of Horn rules and Text corpus and finds the set of evidences supporting or refuting the candidate facts.
This is source code for
ExFaKT: A framework for explaining facts over knowledge graphs and text,
Mohamed Gad-Elrab, Daria Stepanova, Jacopo Urbani, Gerhard Weikum
In 12th International Conference on Web Search and Data Mining, 87-95, ACM 2019.
After cloning the project using git clone --recurse-submodules https://github.com/mhmgad/ExFaKT
, apply the following steps to install dependencies.
This project depends on 2 other projects that are not available as maven repos:
- FactChecking: The code is included
- IRIS-Reasoner: we use libs files built from https://github.com/NICTA/iris-reasoner
To load the libraries into mvn repositry:
sh install_external_jars.sh
Then to generarte scripts and the jar package execute these commands in the project root directory:
mvn clean
mvn initialize
mvn package -Dmaven.test.skip=true
mvn install -Dmaven.test.skip=true
There are 2 main configiration files
- Rewriting Configuration:
QueryRewriting/src/main/resources/fact_checking_rewriting.properties
- Fact Spotting Configuration:
FactChecking/src/main/resources/factchecking.properties
Sample of the configurations can be find in '/src/main/resources/sample_conf' folders. Most of the paramters can be overritten by the CLI arguments.
- clone with
git clone --recurse-submodules https://github.com/mhmgad/ExFaKT
- Download and install or extract Elasticsearch 5.3
- Download Elasticsearch indexed data and extract them
wget http://resources.mpi-inf.mpg.de/d5/exfakt/esData.tar.gz
tar xvzf esData.tar.gz
this includes Yago related index and Wikipedia_sentences
-
change "path.data:" in the folder elasticsearch-5.3.1/config/elasticsearch.yml to the extracted esData folder
path.data:<path>/esData
-
start Elasticsearch
./<elasticsearch_path>/bin/elasticsearch
-
Then you can directly run the webservice using
sh ./scripts/run_webservice2.sh elasticsearch_host eleasticsearch_port
Note: the script assumes that Elasticsearch is running on a different machine and initiate a ssh tunnel, you can skip it if both are on the same machine.
You can use the java client to call explanation API.
The main running scripts are generated into queryrewriting/assembler/bin folder.
To spot facts with the rewriting process, we run:
sh QueryRewriting/assemble/bin/check_facts.sh
Arguments
usage: check_facts.sh [options]
-cf,--ckeckFact Check correctness of a fact
-conf,--configurationFile <file> Input configuration file
-eval,--EvaluationMethod <method> Evaluation Method
-f,--factsFiles <file> Facts File
-h,--help Show Help
-o,--outputFile <file> Output File
-q,--queryFiles <file> Query File in IRIS format
-r,--rulesFiles <file> Rules File
-spotConf,--spottingConfigurationFile <file> Spotting configuration file
sh QueryRewriting/assemble/bin/eval_labels.sh <column with ranking score> <column with labels> <input file>