Skip to content

Producing LLFs

Fibo Kowalsky edited this page Jan 4, 2023 · 3 revisions

In case you are interested in logical forms, called Lambda Logical Forms (LLFs), used by the prover, you can obtain them from CCG derivations.

After you get into the prolog environment by:

swipl -f prolog/main.pl -l ccg_sen_d/SICK_trial_ccg.pl ccg_sen_d/SICK_trial_sen.pl

You can obtain LLFs in XML and (optional) HTML formats by running:

parList([html]), xml_probs_llfs([4,24,211], 'My_LLFs').    % or xml_probs_llfs([4,24,211]) where 'RTE_LLF' is a default file name 

This will create xml/My_LLFs.xml which contains a CCG (derivation) tree, a CCG term, a corrected CCG term, and the first LLF (1LLF) for each sentence of the RTE problems [4,24,211]. Due to parList([html]), you will also get an HTML output for these terms in xml/My_LLFs.html.

In order to get HTML files, the script uses xsltproc. You can get exactly these quadruples of terms according to the sentence IDs too:

parList([html]), xml_senIDs_llfs(1-6, 'My_LLFs').    % or xml_senIDs_llfs([1,2,3,4,5,6], 'My_LLFs') or even omitting the file name 

Because the first six sentences coincide with the sentences of the first three RTE problems in the RTE dataset (i.e. two sentences per problem).

To get CCG trees, CCG terms, corrected CCG terms, and 1LLFs for all sentences in the dataset, use:

parList([]), xml_senIDs_llfs(_, 'All_LLFs').                    % only XML file
parList([html]), xml_senIDs_llfs(_, 'All_LLFs').   % XML and HTML files, XSL transformation will take some time

You can also get CCG trees, ..., 1LLFs per sentence from CCG derivations in prolog format, without the RTE problem *_sen.pl file.

swipl -f prolog/main.pl -l ccg_sen_d/SICK_trial_ccg.pl ccg_sen_d/SICK_trial_sen.pl
?- parList([html]), xml_senIDs_llfs(_, 'All_LLFs').

Doing the same as above but avoiding entering the prolog's interactive environment:

swipl -g "parList([html]), xml_senIDs_llfs(_, 'All_LLFs'), halt" -f prolog/main.pl -l ccg_sen_d/SICK_trial_ccg.pl
Clone this wiki locally