Support vocab arg in spacy.blank

This commit is contained in:
Ines Montani 2020-09-15 11:39:36 +02:00
parent 99549a5ace
commit eff9406718
1 changed files with 3 additions and 0 deletions

View File

@ -18,6 +18,7 @@ from .util import registry, logger # noqa: F401
from .errors import Errors from .errors import Errors
from .language import Language from .language import Language
from .vocab import Vocab
from . import util from . import util
@ -49,12 +50,14 @@ def load(
def blank( def blank(
name: str, name: str,
*, *,
vocab: Union[Vocab, bool] = True,
config: Union[Dict[str, Any], Config] = util.SimpleFrozenDict(), config: Union[Dict[str, Any], Config] = util.SimpleFrozenDict(),
meta: Dict[str, Any] = util.SimpleFrozenDict() meta: Dict[str, Any] = util.SimpleFrozenDict()
) -> Language: ) -> Language:
"""Create a blank nlp object for a given language code. """Create a blank nlp object for a given language code.
name (str): The language code, e.g. "en". name (str): The language code, e.g. "en".
vocab (Vocab): A Vocab object. If True, a vocab is created.
config (Dict[str, Any] / Config): Optional config overrides. config (Dict[str, Any] / Config): Optional config overrides.
meta (Dict[str, Any]): Overrides for nlp.meta. meta (Dict[str, Any]): Overrides for nlp.meta.
RETURNS (Language): The nlp object. RETURNS (Language): The nlp object.