concepts.language.neural_ccg.grammar.NeuralCCGSimpleConjFunction#

class NeuralCCGSimpleConjFunction[source]#

Bases: NeuralCCGConjGroundingFunction

A simple implementation for conjunction-typed semantics.

This function takes a function that works for Value and automatically converts it to a function that works for NeuralCCGGroundingFunction.

The initializer takes a function that takes two arguments and returns a Value. When the conjunction lexicon is combined with two semantic forms which has a value type, this combination function will be called to produce the result. When the conjunction lexicon is combined with two semantic forms which has a function type, this combination function will be called to produce a new function:

def new_function(*args):
    return combination_function(left_function(*args), right_function(*args))

Methods

Attributes

executor

The executor for the domain.

primitive_function

The primitive function that is used to execute the conjunction-typed semantics at the primitive level.

note

The note for the function.

__call__(left_buffer, left_type, right_buffer, right_type)[source]#

Execute the conjunction-typed semantic form.

Parameters:
Return type:

NeuralCCGSemanticsExecutionBuffer

__init__(executor, primitive_function, note='<anonymous conj>')[source]#

Initialize the conjunction-typed semantics.

Parameters:
  • executor (FunctionDomainExecutor) – the executor for the domain.

  • primitive_function (Function) – the primitive function that is used to implement the conjunction-typed semantics.

  • note – the note for the function. This is used for debugging.

__new__(**kwargs)#
executor: FunctionDomainExecutor#

The executor for the domain.

note: Any#

The note for the function. This is used for debugging.

primitive_function: Function#

The primitive function that is used to execute the conjunction-typed semantics at the primitive level.