mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 20:28:20 +03:00
a9c6104047
* Add work in progress * Update analysis helpers and component decorator * Fix porting of docstrings for Python 2 * Fix docstring stuff on Python 2 * Support meta factories when loading model * Put auto pipeline analysis behind flag for now * Analyse pipes on remove_pipe and replace_pipe * Move analysis to root for now Try to find a better place for it, but it needs to go for now to avoid circular imports * Simplify decorator Don't return a wrapped class and instead just write to the object * Update existing components and factories * Add condition in factory for classes vs. functions * Add missing from_nlp classmethods * Add "retokenizes" to printed overview * Update assigns/requires declarations of builtins * Only return data if no_print is enabled * Use multiline table for overview * Don't support Span * Rewrite errors/warnings and move them to spacy.errors
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
# coding: utf8
|
|
from __future__ import unicode_literals
|
|
import warnings
|
|
import sys
|
|
|
|
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
|
|
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
|
|
|
|
# These are imported as part of the API
|
|
from thinc.neural.util import prefer_gpu, require_gpu
|
|
|
|
from . import pipeline
|
|
from .cli.info import info as cli_info
|
|
from .glossary import explain
|
|
from .about import __version__
|
|
from .errors import Errors, Warnings, deprecation_warning
|
|
from . import util
|
|
from .util import register_architecture, get_architecture
|
|
from .language import component
|
|
|
|
|
|
if sys.maxunicode == 65535:
|
|
raise SystemError(Errors.E130)
|
|
|
|
|
|
def load(name, **overrides):
|
|
depr_path = overrides.get("path")
|
|
if depr_path not in (True, False, None):
|
|
deprecation_warning(Warnings.W001.format(path=depr_path))
|
|
return util.load_model(name, **overrides)
|
|
|
|
|
|
def blank(name, **kwargs):
|
|
LangClass = util.get_lang_class(name)
|
|
return LangClass(**kwargs)
|
|
|
|
|
|
def info(model=None, markdown=False, silent=False):
|
|
return cli_info(model, markdown, silent)
|