concepts.language.neural_ccg.search.NeuralCCGLexiconEnumerativeSearcherWithSyntax#
- class NeuralCCGLexiconEnumerativeSearcherWithSyntax[source]#
Bases:
NeuralCCGLexiconSearcherBase
An enumerative neural CCG lexicon searcher. This function also searches for the linguistic syntax type of the semantic form.
Methods
gen
([init_executor, allow_none_lexicon, ...])Generate a list of candidate lexicons.
is_compatible
(semantics_type, syntax_type)is_primitive_compatible
(dsl_type, syntax_type)- __init__(candidate_expressions, allowed_syntax_types, executor, primitive_syntax_compatible=Callable[[TypeBase, CCGPrimitiveSyntaxType], bool])[source]#
Initialize the searcher.
- Parameters:
candidate_semantics (Union[list, CCGSemanticsSearcherBase]) – the semantics searcher.
allowed_syntax_types (List[CCGSyntaxType]) – a list of allowed syntax types.
executor (QSImplementation) – executor.
primitive_syntax_compatible ((TypeBase, CCGBasicSyntaxType) -> bool) – an optional function.
candidate_expressions (List[FunctionDomainExpressionSearchResult])
- __new__(**kwargs)#
- gen(init_executor=True, allow_none_lexicon=False, semantics_hash=None)[source]#
Generate a list of candidate lexicons.
- Returns:
A list of candidate lexicons, as a list of
NeuralCCGLexiconSearchResult
.- Parameters:
- Return type:
- is_compatible(semantics_type, syntax_type)[source]#
- Parameters:
semantics_type (NeuralCCGSyntaxType)
syntax_type (CCGSyntaxType)
- is_primitive_compatible(dsl_type, syntax_type)[source]#
- Parameters:
dsl_type (TypeBase)
syntax_type (CCGSyntaxType)