spaCy - Util.is_package



As the name implies, this utility function is used to get the path of an installed spacy package. It is mainly used to resolve the location of spacy model packages.

Argument

The table below explains its argument −

NAME TYPE DESCRIPTION
name Unicode It is the name of the installed package.

Example 1

An example of util.is_package() function is as follows −

import spacy
spacy.util.is_package("en_core_web_sm")

Output

When you execute the above code, you should see the following output −

True

Example 2

An another example for util.is_package() function is given below −

spacy.util.is_package("English")

Output

When you execute the above code, you should see the following output −

False
spacy_util_get_data_path.htm
Advertisements