diff --git a/spacy/language.py b/spacy/language.py index 7ecbbbafa..484019f64 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -130,7 +130,7 @@ class Language(object): vocab (Vocab): A `Vocab` object. If `True`, a vocab is created via `Language.Defaults.create_vocab`. - make_doc (function): A function that takes text and returns a `Doc` + make_doc (callable): A function that takes text and returns a `Doc` object. Usually a `Tokenizer`. pipeline (list): A list of annotation processes or IDs of annotation, processes, e.g. a `Tagger` object, or `'tagger'`. IDs are looked @@ -189,7 +189,7 @@ class Language(object): docs (iterable): A batch of `Doc` objects. golds (iterable): A batch of `GoldParse` objects. drop (float): The droput rate. - sgd (function): An optimizer. + sgd (callable): An optimizer. RETURNS (dict): Results from the update. EXAMPLE: diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index d3018ffd7..04f62b6bc 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -130,7 +130,7 @@ class TokenVectorEncoder(object): docs (iterable): A batch of `Doc` objects. golds (iterable): A batch of `GoldParse` objects. drop (float): The droput rate. - sgd (function): An optimizer. + sgd (callable): An optimizer. RETURNS (dict): Results from the update. """ if isinstance(docs, Doc): diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index ae9f9af36..952faf17f 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -106,7 +106,7 @@ cdef class Vocab: See also: `Lexeme.set_flag`, `Lexeme.check_flag`, `Token.set_flag`, `Token.check_flag`. - flag_getter (function): A function `f(unicode) -> bool`, to get the flag + flag_getter (callable): A function `f(unicode) -> bool`, to get the flag value. flag_id (int): An integer between 1 and 63 (inclusive), specifying the bit at which the flag will be stored. If -1, the lowest diff --git a/website/docs/api/language.jade b/website/docs/api/language.jade index 93df56f1a..89ff5de3c 100644 --- a/website/docs/api/language.jade +++ b/website/docs/api/language.jade @@ -29,7 +29,7 @@ p Initialise a #[code Language] object. +row +cell #[code make_doc] - +cell function + +cell callable +cell | A function that takes text and returns a #[code Doc] object. | Usually a #[code Tokenizer]. @@ -111,7 +111,7 @@ p Update the models in the pipeline. +row +cell #[code sgd] - +cell function + +cell callable +cell An optimizer. +footrow diff --git a/website/docs/api/matcher.jade b/website/docs/api/matcher.jade index 00d2a626d..6b1b233e6 100644 --- a/website/docs/api/matcher.jade +++ b/website/docs/api/matcher.jade @@ -188,7 +188,7 @@ p +row +cell #[code on_match] - +cell function or #[code None] + +cell callable or #[code None] +cell | Callback function to act on matches. Takes the arguments | #[code matcher], #[code doc], #[code i] and #[code matches].