concepts.language.ccg.learning.by_grounding#
- by_grounding(by_parsing_learning_func, ccg, sentence, executor, criterion, **by_parsing_kwargs)[source]#
Learn a CCG lexicon from a sentence by both parsing the sentence and grounding the parsing result with a given executor.
- Parameters:
by_parsing_learning_func (Callable) – the function to be used for learning a CCG lexicon from a sentence by parsing the sentence. Can be either
by_parsing()
orby_parsing_with_lexicon_gen()
.ccg (CCG) – the CCG grammar.
executor (Callable[[Function | ConstantExpression | FunctionApplicationExpression], Any]) – the executor used to ground the parsing result.
criterion (Callable[[Any], bool]) – the criterion used to classify whether the execution result is correct.
**by_parsing_kwargs – the keyword arguments to be passed to the
by_parsing_learning_func
.
- Returns:
The result of the learning process, as a list of
CCGLearningResult
.- Return type: