Download Overview Manual pages Treebank Semantics Corpus More Tools

Welcome to

Treebank Semantics —
Meaning Representations from Treebanks

What is Treebank Semantics?

Treebank Semantics is an implemented system that automatically derives meaning representations of quality from treebank annotations. The central component is a system of evaluation for a small formal language with respect to a structured information state. Inputs to the system are expressions of the formal language obtained from the conversion of parsed treebank data. Outputs by default are Davidsonian (higher order) predicate logic meaning representations.

The system is distributed freely.

Having a system of formal evaluation as the basis for generating meaning representations makes possible accepting input with minimal conversion from existing treebanks. To see ready made examples, explore the content of the github repository of the Treebank Semantics Corpus. This is a testing ground for the system, with meaning representations built automatically by the system from treebank files annotated in the style of the Annotation manual for the Penn Historical Corpora and the PCEEC (Santorini 2010).

Book

A book describing the approach and implementation is published by Springer-Verlag.

Acknowledgements

Development is funded by the Japan Science and Technology Agency (JST) and the Japan Society for the Promotion of Science (JSPS).

Feedback

Feedback is extremely welcome. Please email: ajb129 __AT__ hotmail __DOT__ com.



Manual pages

    lang_pretty(1)presentation of predicate logic expressions
    pretty_sct(1)pretty printer
    run_sct(1)create meaning representation
    see_sct(1)create SCT expression


lang_pretty(1)lang_pretty(1)

NAME

lang_pretty - presentation of predicate logic expressions

SYNOPSIS

lang_pretty [OPTIONS]

DESCRIPTION

A simple filter of the standard output from run_sct.

OPTIONS

--plain|--raw)plain format (default is for colour terminal)
--example)show an example
*)show this help message

EXAMPLE

$ cat << EOF | lang_pretty --plain
> <top>
>   <quant name="∃">
>     <bound>
>       <term sort="ATTRIB" id="2" />
>       <term sort="EVENT" id="4" />
>       <term sort="ENTITY" id="3" />
>       <term sort="ENTITY" id="1" />
>     </bound>
>     <conj name="∧">
>       <predicate name="hill">
>         <term sort="ENTITY" id="3" />
>       </predicate>
>       <predicate name="is_happy_on">
>         <term sort="ATTRIB" id="2" />
>         <term sort="ENTITY" id="3" />
>       </predicate>
>       <predicate name="is_man_ATTRIBUTE">
>         <term sort="ENTITY" id="1" />
>         <term sort="ATTRIB" id="2" />
>       </predicate>
>       <predicate name="past">
>         <term sort="EVENT" id="4" />
>       </predicate>
>       <predicate name="cried">
>         <term sort="EVENT" id="4" />
>         <term sort="ENTITY" id="1" />
>       </predicate>
>     </conj>
>   </quant>
> </top>
> EOF
-| ∃ ATTRIB[2] EVENT[4] ENTITY[3] ENTITY[1] (
-|       hill(ENTITY[3])
-|     ∧ is_happy_on(ATTRIB[2], ENTITY[3])
-|     ∧ is_man_ATTRIBUTE(ENTITY[1], ATTRIB[2])
-|     ∧ past(EVENT[4])
-|     ∧ cried(EVENT[4], ENTITY[1]))
-| 

SEE ALSO

pretty_sct(1)



pretty_sct(1)pretty_sct(1)

NAME

pretty_sct - pretty printer

SYNOPSIS

pretty_sct

DESCRIPTION

Filter that pretty prints SCT expressions.

OPTIONS

--example)show an example
*)show this help message

EXAMPLE

$ cat << EOF | pretty_sct
> (* english *)
> 
> val sent = (fn fh => (fn lc => (npr "ENTITY" "Bunthorne" "ARG0" (past ".event" (verb lc (gensym "EVENT") ".event" ["ARG0"] "entered")))) ["ARG0", "ARG1", "h"]) ["@e", ".event"];
> 
> val _ = translate ["@e", ".event"] "english" sent;
> 
> EOF
-| (* english *)
-| 
-| val sent =
-| ( fn fh =>
-|   ( fn lc =>
-|     ( npr "ENTITY" "Bunthorne" "ARG0"
-|       ( past ".event"
-|         ( verb lc
-|           ( gensym "EVENT") ".event" ["ARG0"] "entered"))))
-|   [ "ARG0", "ARG1", "h"])
-| [ "@e", ".event"]
-| ;
-| 
-| val _ = translate ["@e", ".event"] "english" sent;
-| 

SEE ALSO

pretty_lang(1)



run_sct(1)run_sct(1)

NAME

run_sct - create meaning representation

SYNOPSIS

run_sct [OPTIONS]

DESCRIPTION

Reads SCT representation from stdin, returns meaning representation to stdout.

OPTIONS

#
# influence presentation of output (default is xml lang format)
#
--raw)Standard ML lang output
--seprs|-s)symbolic expression output
--xhtml|-x)sends evaluation illustration to "output.xhtml" (no stdout)
--reduced)output reduced form of the input SCT expression
#
# influence what is present with the output
#
--roles)keep role information for predicate arguments
--untrans)output untransformed representation
--free)keep free variables
--balance)check balance for If conditions of the input SCT expression
#
# influence compiler choice (default compiler is PolyML without precompiling)
#
--poly)use PolyML as Standard ML compiler with precompiling
--mosml)use MOSML as Standard ML compiler
--smlnj)use SML/NJ as Standard ML compiler
--mlkit)use MLKit as Standard ML compiler
--mlton)profile with MLTON as Standard ML compiler
#
# help and examples
#
--example)show examples
--keep)keep generated intermediate files
*)show this message

EXAMPLES

$ cat << EOF | run_sct | lang_pretty
> (* english *)
> 
> val sent_i =
> ( fn fh =>
>   ( fn lc =>
>     ( ( fn lc =>
>         ( some lc fh ".e"
>           ( gensym "ENTITY")
>           ( nn lc "cat")))
>       [ "ARG0", "ARG1", "h"] "ARG0"
>       ( verb lc ".event" ["ARG0"] "enters"
>         ( gensym "EVENT"))))
>   [ "ARG0", "ARG1", "h"])
> [ ".e", ".event"]
> ;
> 
> val sent_ii =
> ( fn fh =>
>   ( fn lc =>
>     ( ( fn lc =>
>         ( pro ["*"] fh ["ENTITY"] ".e" "it"
>           ( gensym "ENTITY")))
>       [ "ARG0", "ARG1", "h"] "ARG0"
>       ( verb lc ".event" ["ARG0"] "purrs"
>         ( gensym "EVENT"))))
>   [ "ARG0", "ARG1", "h"])
> [ ".e", ".event"]
> ;
> 
> val sent_iii =
> ( fn fh =>
>   ( fn lc =>
>     ( ( fn lc =>
>         ( ( fn lc =>
>             ( pro ["*"] fh ["ENTITY"] ".e" "it"
>               ( gensym "ENTITY")))
>           [ "ARG0", "ARG1", "h"] "ARG0"
>           ( verb lc ".event" ["ARG0"] "departs"
>             ( gensym "EVENT"))))
>       [ "ARG0", "ARG1", "h"]))
>   [ "ARG0", "ARG1", "h"])
> [ ".e", ".event"]
> ;
> 
> val _ = translate [".e", ".event"] "english" ((fn fh => (conj fh "∧" free [sent_i, sent_ii, sent_iii])) [".e", ".event"]);
> 
> EOF
-| ∃ ENTITY[5] ENTITY[3] EVENT[2] EVENT[4] EVENT[6] ENTITY[1] (
-|       cat(ENTITY[1])
-|     ∧ ENTITY[3] = it:pick1{ENTITY[1]}
-|     ∧ ENTITY[5] = it:pick1{ENTITY[1]}
-|     ∧ enters(EVENT[2], ENTITY[1])
-|     ∧ purrs(EVENT[4], ENTITY[3])
-|     ∧ departs(EVENT[6], ENTITY[5]))
-| 
cat << EOF | run_sct | lang_pretty
> (* english *)
> 
> val sent =
> ( fn fh =>
>   ( fn lc =>
>     ( ( fn lc =>
>         ( every lc fh ".e"
>           ( gensym "ENTITY")
>           ( nn lc "wife")))
>       [ "ARG0", "ARG1", "h"] "ARG0"
>       ( embVerb lc ".event" ["ARG0"] "thinks"
>         ( gensym "EVENT")
>         ( THAT lc
>           ( ( fn lc =>
>               ( ( fn lc =>
>                   ( focusParticle fh "ONLY" ".e"
>                     ( gensym "ENTITY")
>                     ( pro ["*"] fh ["ENTITY"] ".e" "she"
>                       ( gensym "ENTITY"))))
>                 [ "ARG0", "ARG1", "h"] "ARG0"
>                 ( ( fn lc =>
>                     ( some lc fh ".e"
>                       ( gensym "ENTITY")
>                       ( ( fn lc =>
>                           ( pro ["*"] fh ["ENTITY"] ".e" "her"
>                             ( gensym "ENTITY")))
>                         [ "ARG0", "ARG1", "h"] "POS"
>                         ( nn lc "husband"))))
>                   [ "POS", "ARG0", "ARG1", "h"] "ARG1"
>                   ( verb lc ".event" ["ARG1", "ARG0"] "respects"
>                     ( gensym "EVENT")))))
>             [ "ARG1", "ARG0", "h"])))))
>   [ "ARG0", "ARG1", "h"])
> [ ".e", ".event"]
> ;
> 
> val _ = translate [".e", ".event"] "english" sent;
> 
EOF
-| ∀ ENTITY[1] →(
-|       wife(ENTITY[1]),
-|       ∃ ENTITY[6] ENTITY[4] EVENT[7] EVENT[2] ENTITY[5] (
-|           ENTITY[4] = she:pick1{ENTITY[1]}
-|         ∧ ENTITY[6] = her:pick2{ENTITY[4], ENTITY[1]}
-|         ∧ is_husband_POS(ENTITY[5], ENTITY[6])
-|         ∧ thinks_THAT(EVENT[2], ENTITY[1],
-|             (
-|               ONLY(ENTITY[4]),
-|               respects(EVENT[7], ENTITY[4], ENTITY[5])))))
-| 
cat << EOF | run_sct -s | munge-trees -p
> (* english *)
> 
> val sent_i =
> ( fn fh =>
>   ( fn lc =>
>     ( ( fn lc =>
>         ( some lc fh ".e"
>           ( gensym "ENTITY")
>           ( someClassic lc fh ".e" nil
>             ( gensym "ATTRIB")
>             ( adj lc "a") "DETERMINER"
>             ( nn lc "cat"))))
>       [ "DETERMINER", "ARG0", "ARG1", "h"] "ARG0"
>       ( verb lc ".event" ["ARG0"] "enters"
>         ( gensym "EVENT"))))
>   [ "ARG0", "ARG1", "h"])
> [ ".e", ".event"]
> ;
> 
> val sent_ii =
> ( fn fh =>
>   ( fn lc =>
>     ( ( fn lc =>
>         ( pro ["*"] fh ["ENTITY"] ".e" "it"
>           ( gensym "ENTITY")))
>       [ "ARG0", "ARG1", "h"] "ARG0"
>       ( verb lc ".event" ["ARG0"] "purrs"
>         ( gensym "EVENT"))))
>   [ "ARG0", "ARG1", "h"])
> [ ".e", ".event"]
> ;
> 
> val _ = translate [".e", ".event"] "english" ((fn fh => (conj fh "∧" free [sent_i, sent_ii])) [".e", ".event"]);
> 
> cnt := 0;
> 
EOF
-| (TOP (QUANT (EXIST (BOUND @ENTITY;1)
-|                    (BOUND @EVENT;5)
-|                    (BOUND @EVENT;3)
-|                    (BOUND @ATTRIB;2)
-|                    (BOUND @ENTITY;4))
-|             (AND (@ATTRIB;2 a)
-|                  (@ENTITY;1 (cat (:DETERMINER @ATTRIB;2)))
-|                  (@ENTITY;4 (-ENTITY- (:namely @ENTITY;1)))
-|                  (AND (@EVENT;3 (enters (:ARG0 @ENTITY;1)))
-|                       (@EVENT;5 (purrs (:ARG0 @ENTITY;4)))))))


see_sct(1)see_sct(1)

NAME

see_sct - create SCT expression

SYNOPSIS

see_sct [OPTIONS]

DESCRIPTION

Reads syntactic parse from stdin, returns SCT expression to stdout.

All tree content should be on the same line. Discourse is captured when all discourse content is on a single line.

OPTIONS

nuke|--nuke)remove generated output* files
--warning|-w)return SCT expression with warnings of unprocessed materials
--debug|-d)observe how SCT expression is reached
--lang|-l)specify language, e.g., --lang japanese
--free)remove quantification layers
--reset)reset numbering with each sentence/discourse
--example)show examples
*)show this message

EXAMPLES

$ cat << EOF | see_sct | pretty_sct
> ( (IP-MAT (PP (P-ROLE ARG0) (NP (D A) (N cat))) (VB enters) (PU __dot__)) (ID TEST;EN))( (IP-MAT (PP (P-ROLE ARG0) (NP (PRO It))) (VB purrs) (PU __dot__)) (ID TEST;EN))( (IP-SUB (PP (P-ROLE ARG0) (NP (PRO It))) (VB departs) (PU __dot__)) (ID TEST;EN))
> EOF
-| (* english *)
-| 
-| val sent_i =
-| ( fn fh =>
-|   ( fn lc =>
-|     ( ( fn lc =>
-|         ( some lc fh ".e"
-|           ( gensym "ENTITY")
-|           ( nn lc "cat")))
-|       [ "ARG0", "ARG1", "h"] "ARG0"
-|       ( verb lc ".event" ["ARG0"] "enters"
-|         ( gensym "EVENT"))))
-|   [ "ARG0", "ARG1", "h"])
-| [ ".e", ".event"]
-| ;
-| 
-| val sent_ii =
-| ( fn fh =>
-|   ( fn lc =>
-|     ( ( fn lc =>
-|         ( pro ["*"] fh ["ENTITY"] ".e" "it"
-|           ( gensym "ENTITY")))
-|       [ "ARG0", "ARG1", "h"] "ARG0"
-|       ( verb lc ".event" ["ARG0"] "purrs"
-|         ( gensym "EVENT"))))
-|   [ "ARG0", "ARG1", "h"])
-| [ ".e", ".event"]
-| ;
-| 
-| val sent_iii =
-| ( fn fh =>
-|   ( fn lc =>
-|     ( ( fn lc =>
-|         ( ( fn lc =>
-|             ( pro ["*"] fh ["ENTITY"] ".e" "it"
-|               ( gensym "ENTITY")))
-|           [ "ARG0", "ARG1", "h"] "ARG0"
-|           ( verb lc ".event" ["ARG0"] "departs"
-|             ( gensym "EVENT"))))
-|       [ "ARG0", "ARG1", "h"]))
-|   [ "ARG0", "ARG1", "h"])
-| [ ".e", ".event"]
-| ;
-| 
-| val _ = translate [".e", ".event"] "english" ((fn fh => (conj fh "∧" free [sent_i, sent_ii, sent_iii])) [".e", ".event"]);
-| 
cat << EOF | see_sct | pretty_sct
> ( (IP-MAT (PP (P-ROLE ARG0) (NP (ACT __star__TOLOWER__star__) (Q Every) (N wife))) (VB thinks) (CP-THT (IP-SUB (PP (P-ROLE ARG0) (NP (FP only) (PRO she))) (VB respects) (PP (P-ROLE ARG1) (NP (PP (P-ROLE POS) (NP (PRO her))) (N husband))))) (PU __dot__)) (ID TEST;EN))
EOF
-| (* english *)
-| 
-| val sent =
-| ( fn fh =>
-|   ( fn lc =>
-|     ( ( fn lc =>
-|         ( every lc fh ".e"
-|           ( gensym "ENTITY")
-|           ( nn lc "wife")))
-|       [ "ARG0", "ARG1", "h"] "ARG0"
-|       ( embVerb lc ".event" ["ARG0"] "thinks"
-|         ( gensym "EVENT")
-|         ( THAT lc
-|           ( ( fn lc =>
-|               ( ( fn lc =>
-|                   ( focusParticle fh "ONLY" ".e"
-|                     ( gensym "ENTITY")
-|                     ( pro ["*"] fh ["ENTITY"] ".e" "she"
-|                       ( gensym "ENTITY"))))
-|                 [ "ARG0", "ARG1", "h"] "ARG0"
-|                 ( ( fn lc =>
-|                     ( some lc fh ".e"
-|                       ( gensym "ENTITY")
-|                       ( ( fn lc =>
-|                           ( pro ["*"] fh ["ENTITY"] ".e" "her"
-|                             ( gensym "ENTITY")))
-|                         [ "ARG0", "ARG1", "h"] "POS"
-|                         ( nn lc "husband"))))
-|                   [ "POS", "ARG0", "ARG1", "h"] "ARG1"
-|                   ( verb lc ".event" ["ARG1", "ARG0"] "respects"
-|                     ( gensym "EVENT")))))
-|             [ "ARG1", "ARG0", "h"])))))
-|   [ "ARG0", "ARG1", "h"])
-| [ ".e", ".event"]
-| ;
-| 
-| val _ = translate [".e", ".event"] "english" sent;
-| 


Last updated: April 29, 2017