spaCy - Util.load_model_from_init_py



It is introduced in version 2.0. It is a helper function, which is used in the load() method of a model package’s _init_.py</>.

Arguments

The table below explains its arguments −

NAME TYPE DESCRIPTION
init_file unicode It is the path to model’s _ _init_ _.py.
overrides - It represents specific overrides such as the names of pipeline components to disable.

Example

An example of util.load_model_from_init_py() helper function is stated below −

import spacy
from spacy.util import load_model_from_init_py
def load(**overrides):
    return load_model_from_init_py(__file__, **overrides)
spacy_util_get_data_path.htm
Advertisements