concepts.language.neural_ccg.grammar#

The grammar components for neural CCGs, including syntax types, semantic forms, lexicon, and the parser. There are a few debug options that can be enabled by setting the corresponding flags to True, see the foptions variable for details.

Module attributes

foptions

Options for the CCG parser.

Functions

compose_neural_ccg_node(lhs, rhs[, ...])

Compose two neural CCG nodes.

count_nr_execution_steps(parsings)

Count the number of execution steps from a list of parsing results.

gen_used_lexicon_entries(parsings)

Generate a dictionary of used lexicon entries from a list of parsing results.

parse_linearization_string(string)

Parse a linearization string (e.g., /0\1) into a list of tuples.

Classes

LinearizationTuple

A pair of (index, direction) for representing linearization of function arguments.

NeuralCCG

The neural CCG grammar and the implementation for parsing.

NeuralCCGConjGroundingFunction

A wrapper for the underlying implementation of a conjunction-typed semantic form (e.g., AND).

NeuralCCGConjSyntaxType

Data structure for conjunction syntax types.

NeuralCCGGroundingFunction

A data structure contains the implementation of a function (for neural CCG semantics).

NeuralCCGNode

A node in the Neural CCG parsing tree.

NeuralCCGSemantics

We implement the execution result of the current subtree in the following way: For primitive types (syntax.is_value == True), the execution_buffer field is a list containing a single element recording the execution result.

NeuralCCGSemanticsExecutionBuffer

A small data structure that contains the execution buffer, partial type, and number of execution steps.

NeuralCCGSemanticsPartialTypeLex

A data structure that will be used in representing the semantic type of a partially applied function.

NeuralCCGSimpleConjFunction

A simple implementation for conjunction-typed semantics.

NeuralCCGSyntaxType

Data structure for neural CCG syntax types.