This page is to explain the instructions for setting up and running the ATM QA for RTE system, version 0.6. The system currently only works in Linux.
Setup
1. Download the file ATM_QA-0.6-mod.zip
NOTE: This file ALREADY includes
- lparse, smodels (http://www.tcs.hut.fi/Software/smodels/)
- mkatoms (http://www.krlab.cs.ttu.edu/mkatoms/)
- all the necessary scripts (which are described in "File Description" section
2. At the prompt, type the following command to decompress the file ATM_QA-0.6-mod.zip
unzip -q ATM_QA-0.6-mod.zip
3. Do the command ls, and you should see the directory named ATM_QA-0.6/ in the current directory
4. Do the command cd ATM_QA-0.6
5. Type the following command to see if the system is setp correctly:
./do-t-h.sh MODULES/RTE2-21/T.pl MODULES/RTE2-21/H.pl
6. You should see a lot of warnings, but they are fine. What's important is that you should see the following at the end of the display:
answer_true(yes)
assuming("Korea means North Korea")
assuming("Open relations means open diplomatic relations")
assuming("Countries with diplomatic relations normally exchange ambassadors")
7. Great! The ATM QA for RTE system is ready to be used!
System File Description
Inside the ATM_QA-0.6 directory, you should see the following files in the subdirectory MODULES:
axioms.pl: General axioms defining the domain of the problem based on the AnsProlog facts generated from text/hypothesissets.mod: Rules about sets such as cardinality, membership
ontology.pl: core ontology defining basic types and subclasses
Note: This files are not meant to be changed, but it is important to understand the files axioms.pl and ontology.pl
Running an example
To make it easier to follow, the following RTE pair (RTE2-21) is used as an illustration to use the system:Text: North Korea opened relations with 10 other countries: Belgium and Brazil and Canada and Germany and Greece and Kuwait and Luxembourg and the Netherlands and New Zealand and Spain.
Hypothesis: Spain and Korea started ambassadorial relations.
File Description
Input File Description
H.eng: English text for the hypothesis of the problem
T.eng: English text for the text of the problem
semT-files.txt [optional]: list of filenames (BLANK-SEPARATED) that constitute the pair-dependent ontology and semantic translator (by default, the system uses "ontology.pl" and "interface.pl" from the module's directory)
theory-files.txt [optional]: list of filenames that constitute the pair-dependent theory (by default, the system uses "pair.pl" from the module's directory)
interface.pl: rules for semantic translation of facts from hypothesis and text
pair.pl: rules for the domain of the problem
Steps
The following steps guide you through how to run an example and assume the current directory is at ATM_QA-0.6:
1. Download all of the above input files and place them in a subdirectory (let's say RTE3-00) under
MODULES.
2. Syntactic translator - Translate English sentence in <file>.eng to LFT logic form (<file>.lft) and
AnsProlog facts (<file>.pl):
./english-to-apl.sh MODULES/RTE3-00/H.eng
./english-to-apl.sh MODULES/RTE3-00/T.eng
LFT logic forms for the text (T.lft) and hypothesis (H.lft), as well as AnsProlog facts for the
text (T.pl) and hypothesis (H.pl) are generated using this script.
3. Semantic translator - Generate facts from hypothesis H using axioms.pl, interface.pl, pair.pl using
smodels:
./run-passage.sh --semT-only MODULES/RTE3-00/H.pl RTE3-00 > MODULES/RTE3-00/H.ans
4. Query generator - Generate AnsProlog query from the AnsProlog facts for the hypothesis H.pl:
./questioner.sh MODULES/RTE3-00/H.ans > MODULES/RTE3-00/query.pl
Notice that only the facts with predicates h, o and name are used to form the query
5. Combine the facts from text together (T.pl) with query (query.pl) to generate the file "T-query.pl"
with the command:
cat MODULES/RTE3-00/T.pl MODULES/RTE3-00/query.pl > MODULES/RTE3-00/T-query.pl
6. Semantic translator - Find answers (true, false, or unknown) using the AnsProlog facts in T.pl
and the query in query.pl together with axioms.pl, interface.pl, pair.pl using smodels:
./run-passage.sh MODULES/RTE2-21/T-query.pl RTE2-21
** Note: Alternatively, steps 2 to 6 can be performed using the script do-t-h.sh:
./do-t-h.sh MODULES/RTE2-21/T.pl MODULES/RTE2-21/H.pl
Hints
- You should use run-passage.sh and questioner.sh for debugging the program
- Each time you create a pair, you should create a directory under MODULES and place your working files under this subdirectory
- For implementation, you should have your own interface.pl and pair.pl programs. If you need to have extra programs other than interface.pl, pair.pl, then you need to modify the optional files semT-files.txt and theory-files.txt.