2019-09-30 21:10:55 +03:00
|
|
|
[metadata]
|
|
|
|
description = Industrial-strength Natural Language Processing (NLP) in Python
|
|
|
|
url = https://spacy.io
|
|
|
|
author = Explosion
|
|
|
|
author_email = contact@explosion.ai
|
|
|
|
license = MIT
|
|
|
|
long_description = file: README.md
|
|
|
|
long_description_content_type = text/markdown
|
|
|
|
classifiers =
|
|
|
|
Development Status :: 5 - Production/Stable
|
|
|
|
Environment :: Console
|
|
|
|
Intended Audience :: Developers
|
|
|
|
Intended Audience :: Science/Research
|
|
|
|
License :: OSI Approved :: MIT License
|
|
|
|
Operating System :: POSIX :: Linux
|
|
|
|
Operating System :: MacOS :: MacOS X
|
|
|
|
Operating System :: Microsoft :: Windows
|
|
|
|
Programming Language :: Cython
|
|
|
|
Programming Language :: Python :: 3
|
|
|
|
Programming Language :: Python :: 3.6
|
|
|
|
Programming Language :: Python :: 3.7
|
2019-10-19 19:13:25 +03:00
|
|
|
Programming Language :: Python :: 3.8
|
2020-11-23 11:45:18 +03:00
|
|
|
Programming Language :: Python :: 3.9
|
2021-10-28 16:32:06 +03:00
|
|
|
Programming Language :: Python :: 3.10
|
2019-09-30 21:10:55 +03:00
|
|
|
Topic :: Scientific/Engineering
|
2021-05-31 11:38:29 +03:00
|
|
|
project_urls =
|
|
|
|
Release notes = https://github.com/explosion/spaCy/releases
|
|
|
|
Source = https://github.com/explosion/spaCy
|
2019-09-30 21:10:55 +03:00
|
|
|
|
|
|
|
[options]
|
|
|
|
zip_safe = false
|
|
|
|
include_package_data = true
|
2019-12-22 03:53:56 +03:00
|
|
|
python_requires = >=3.6
|
2019-09-30 21:10:55 +03:00
|
|
|
install_requires =
|
2019-11-04 04:39:28 +03:00
|
|
|
# Our libraries
|
Fix entity linker batching (#9669)
* Partial fix of entity linker batching
* Add import
* Better name
* Add `use_gold_ents` option, docs
* Change to v2, create stub v1, update docs etc.
* Fix error type
Honestly no idea what the right type to use here is.
ConfigValidationError seems wrong. Maybe a NotImplementedError?
* Make mypy happy
* Add hacky fix for init issue
* Add legacy pipeline entity linker
* Fix references to class name
* Add __init__.py for legacy
* Attempted fix for loss issue
* Remove placeholder V1
* formatting
* slightly more interesting train data
* Handle batches with no usable examples
This adds a test for batches that have docs but not entities, and a
check in the component that detects such cases and skips the update step
as thought the batch were empty.
* Remove todo about data verification
Check for empty data was moved further up so this should be OK now - the
case in question shouldn't be possible.
* Fix gradient calculation
The model doesn't know which entities are not in the kb, so it generates
embeddings for the context of all of them.
However, the loss does know which entities aren't in the kb, and it
ignores them, as there's no sensible gradient.
This has the issue that the gradient will not be calculated for some of
the input embeddings, which causes a dimension mismatch in backprop.
That should have caused a clear error, but with numpyops it was causing
nans to happen, which is another problem that should be addressed
separately.
This commit changes the loss to give a zero gradient for entities not in
the kb.
* add failing test for v1 EL legacy architecture
* Add nasty but simple working check for legacy arch
* Clarify why init hack works the way it does
* Clarify use_gold_ents use case
* Fix use gold ents related handling
* Add tests for no gold ents and fix other tests
* Use aligned ents function (not working)
This doesn't actually work because the "aligned" ents are gold-only. But
if I have a different function that returns the intersection, *then*
this will work as desired.
* Use proper matching ent check
This changes the process when gold ents are not used so that the
intersection of ents in the pred and gold is used.
* Move get_matching_ents to Example
* Use model attribute to check for legacy arch
* Rename flag
* bump spacy-legacy to lower 3.0.9
Co-authored-by: svlandeg <svlandeg@github.com>
2022-03-04 11:17:36 +03:00
|
|
|
spacy-legacy>=3.0.9,<3.1.0
|
2021-09-29 12:12:50 +03:00
|
|
|
spacy-loggers>=1.0.0,<2.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
murmurhash>=0.28.0,<1.1.0
|
|
|
|
cymem>=2.0.2,<2.1.0
|
|
|
|
preshed>=3.0.2,<3.1.0
|
2022-07-08 18:52:41 +03:00
|
|
|
thinc>=8.1.0,<8.2.0
|
2022-04-07 11:48:45 +03:00
|
|
|
wasabi>=0.9.1,<1.1.0
|
2022-04-13 12:41:40 +03:00
|
|
|
srsly>=2.4.3,<3.0.0
|
2021-08-25 15:58:01 +03:00
|
|
|
catalogue>=2.0.6,<2.1.0
|
2021-08-31 13:53:51 +03:00
|
|
|
typer>=0.3.0,<0.5.0
|
2021-03-02 14:06:59 +03:00
|
|
|
pathy>=0.3.5
|
2019-11-04 04:39:28 +03:00
|
|
|
# Third-party dependencies
|
2020-01-29 19:35:46 +03:00
|
|
|
tqdm>=4.38.0,<5.0.0
|
2019-11-04 04:39:28 +03:00
|
|
|
numpy>=1.15.0
|
|
|
|
requests>=2.13.0,<3.0.0
|
2022-05-25 10:33:54 +03:00
|
|
|
pydantic>=1.7.4,!=1.8,!=1.8.1,<1.10.0
|
2020-10-19 20:04:42 +03:00
|
|
|
jinja2
|
2020-05-30 15:59:55 +03:00
|
|
|
# Official Python utilities
|
|
|
|
setuptools
|
2020-10-06 15:16:05 +03:00
|
|
|
packaging>=20.0
|
2022-06-02 18:22:34 +03:00
|
|
|
typing_extensions>=3.7.4,<4.2.0; python_version < "3.8"
|
2021-10-05 10:52:22 +03:00
|
|
|
langcodes>=3.2.0,<4.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
|
2020-07-01 21:21:05 +03:00
|
|
|
[options.entry_points]
|
|
|
|
console_scripts =
|
2021-05-28 19:15:31 +03:00
|
|
|
spacy = spacy.cli:setup_cli
|
2020-07-01 21:21:05 +03:00
|
|
|
|
2019-09-30 21:10:55 +03:00
|
|
|
[options.extras_require]
|
2019-10-01 01:01:27 +03:00
|
|
|
lookups =
|
2021-09-30 15:18:47 +03:00
|
|
|
spacy_lookups_data>=1.0.3,<1.1.0
|
2020-10-03 12:13:00 +03:00
|
|
|
transformers =
|
2021-10-28 12:18:19 +03:00
|
|
|
spacy_transformers>=1.1.2,<1.2.0
|
2020-10-08 11:58:50 +03:00
|
|
|
ray =
|
2020-10-08 12:10:48 +03:00
|
|
|
spacy_ray>=0.1.0,<1.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
cuda =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy>=5.0.0b4,<11.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
cuda80 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda80>=5.0.0b4,<11.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
cuda90 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda90>=5.0.0b4,<11.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
cuda91 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda91>=5.0.0b4,<11.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
cuda92 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda92>=5.0.0b4,<11.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
cuda100 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda100>=5.0.0b4,<11.0.0
|
2020-04-29 13:51:12 +03:00
|
|
|
cuda101 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda101>=5.0.0b4,<11.0.0
|
2020-04-29 13:51:12 +03:00
|
|
|
cuda102 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda102>=5.0.0b4,<11.0.0
|
2020-10-23 12:27:54 +03:00
|
|
|
cuda110 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda110>=5.0.0b4,<11.0.0
|
2020-12-10 17:34:34 +03:00
|
|
|
cuda111 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda111>=5.0.0b4,<11.0.0
|
2021-03-30 10:47:33 +03:00
|
|
|
cuda112 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda112>=5.0.0b4,<11.0.0
|
2021-10-28 16:32:06 +03:00
|
|
|
cuda113 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda113>=5.0.0b4,<11.0.0
|
2021-10-28 16:32:06 +03:00
|
|
|
cuda114 =
|
2021-12-20 17:48:35 +03:00
|
|
|
cupy-cuda114>=5.0.0b4,<11.0.0
|
|
|
|
cuda115 =
|
|
|
|
cupy-cuda115>=5.0.0b4,<11.0.0
|
2022-06-30 12:24:37 +03:00
|
|
|
cuda116 =
|
|
|
|
cupy-cuda116>=5.0.0b4,<11.0.0
|
|
|
|
cuda117 =
|
|
|
|
cupy-cuda117>=5.0.0b4,<11.0.0
|
2021-10-29 11:35:31 +03:00
|
|
|
apple =
|
2022-06-21 09:26:59 +03:00
|
|
|
thinc-apple-ops>=0.1.0.dev0,<1.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
# Language tokenizers with external dependencies
|
|
|
|
ja =
|
2022-01-17 13:48:39 +03:00
|
|
|
sudachipy>=0.5.2,!=0.6.1
|
|
|
|
sudachidict_core>=20211220
|
2019-09-30 21:10:55 +03:00
|
|
|
ko =
|
2022-08-26 11:11:18 +03:00
|
|
|
mecab-ko>=1.0.0
|
2019-09-30 21:10:55 +03:00
|
|
|
th =
|
|
|
|
pythainlp>=2.0
|
|
|
|
|
|
|
|
[bdist_wheel]
|
|
|
|
universal = false
|
|
|
|
|
|
|
|
[sdist]
|
|
|
|
formats = gztar
|
|
|
|
|
|
|
|
[flake8]
|
2021-06-28 13:03:29 +03:00
|
|
|
ignore = E203, E266, E501, E731, W503, E741, F541
|
2019-09-30 21:10:55 +03:00
|
|
|
max-line-length = 80
|
|
|
|
select = B,C,E,F,W,T4,B9
|
|
|
|
exclude =
|
|
|
|
.env,
|
|
|
|
.git,
|
|
|
|
__pycache__,
|
|
|
|
_tokenizer_exceptions_list.py,
|
2019-10-01 22:36:04 +03:00
|
|
|
|
|
|
|
[tool:pytest]
|
|
|
|
markers =
|
2021-10-11 14:56:24 +03:00
|
|
|
slow: mark a test as slow
|
|
|
|
issue: reference specific issue
|
2020-07-25 16:01:15 +03:00
|
|
|
|
|
|
|
[mypy]
|
|
|
|
ignore_missing_imports = True
|
|
|
|
no_implicit_optional = True
|
|
|
|
plugins = pydantic.mypy, thinc.mypy
|
🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167)
* 🚨 Ignore all existing Mypy errors
* 🏗 Add Mypy check to CI
* Add types-mock and types-requests as dev requirements
* Add additional type ignore directives
* Add types packages to dev-only list in reqs test
* Add types-dataclasses for python 3.6
* Add ignore to pretrain
* 🏷 Improve type annotation on `run_command` helper
The `run_command` helper previously declared that it returned an
`Optional[subprocess.CompletedProcess]`, but it isn't actually possible
for the function to return `None`. These changes modify the type
annotation of the `run_command` helper and remove all now-unnecessary
`# type: ignore` directives.
* 🔧 Allow variable type redefinition in limited contexts
These changes modify how Mypy is configured to allow variables to have
their type automatically redefined under certain conditions. The Mypy
documentation contains the following example:
```python
def process(items: List[str]) -> None:
# 'items' has type List[str]
items = [item.split() for item in items]
# 'items' now has type List[List[str]]
...
```
This configuration change is especially helpful in reducing the number
of `# type: ignore` directives needed to handle the common pattern of:
* Accepting a filepath as a string
* Overwriting the variable using `filepath = ensure_path(filepath)`
These changes enable redefinition and remove all `# type: ignore`
directives rendered redundant by this change.
* 🏷 Add type annotation to converters mapping
* 🚨 Fix Mypy error in convert CLI argument verification
* 🏷 Improve type annotation on `resolve_dot_names` helper
* 🏷 Add type annotations for `Vocab` attributes `strings` and `vectors`
* 🏷 Add type annotations for more `Vocab` attributes
* 🏷 Add loose type annotation for gold data compilation
* 🏷 Improve `_format_labels` type annotation
* 🏷 Fix `get_lang_class` type annotation
* 🏷 Loosen return type of `Language.evaluate`
* 🏷 Don't accept `Scorer` in `handle_scores_per_type`
* 🏷 Add `string_to_list` overloads
* 🏷 Fix non-Optional command-line options
* 🙈 Ignore redefinition of `wandb_logger` in `loggers.py`
* ➕ Install `typing_extensions` in Python 3.8+
The `typing_extensions` package states that it should be used when
"writing code that must be compatible with multiple Python versions".
Since SpaCy needs to support multiple Python versions, it should be used
when newer `typing` module members are required. One example of this is
`Literal`, which is available starting with Python 3.8.
Previously SpaCy tried to import `Literal` from `typing`, falling back
to `typing_extensions` if the import failed. However, Mypy doesn't seem
to be able to understand what `Literal` means when the initial import
means. Therefore, these changes modify how `compat` imports `Literal` by
always importing it from `typing_extensions`.
These changes also modify how `typing_extensions` is installed, so that
it is a requirement for all Python versions, including those greater
than or equal to 3.8.
* 🏷 Improve type annotation for `Language.pipe`
These changes add a missing overload variant to the type signature of
`Language.pipe`. Additionally, the type signature is enhanced to allow
type checkers to differentiate between the two overload variants based
on the `as_tuple` parameter.
Fixes #8772
* ➖ Don't install `typing-extensions` in Python 3.8+
After more detailed analysis of how to implement Python version-specific
type annotations using SpaCy, it has been determined that by branching
on a comparison against `sys.version_info` can be statically analyzed by
Mypy well enough to enable us to conditionally use
`typing_extensions.Literal`. This means that we no longer need to
install `typing_extensions` for Python versions greater than or equal to
3.8! 🎉
These changes revert previous changes installing `typing-extensions`
regardless of Python version and modify how we import the `Literal` type
to ensure that Mypy treats it properly.
* resolve mypy errors for Strict pydantic types
* refactor code to avoid missing return statement
* fix types of convert CLI command
* avoid list-set confustion in debug_data
* fix typo and formatting
* small fixes to avoid type ignores
* fix types in profile CLI command and make it more efficient
* type fixes in projects CLI
* put one ignore back
* type fixes for render
* fix render types - the sequel
* fix BaseDefault in language definitions
* fix type of noun_chunks iterator - yields tuple instead of span
* fix types in language-specific modules
* 🏷 Expand accepted inputs of `get_string_id`
`get_string_id` accepts either a string (in which case it returns its
ID) or an ID (in which case it immediately returns the ID). These
changes extend the type annotation of `get_string_id` to indicate that
it can accept either strings or IDs.
* 🏷 Handle override types in `combine_score_weights`
The `combine_score_weights` function allows users to pass an `overrides`
mapping to override data extracted from the `weights` argument. Since it
allows `Optional` dictionary values, the return value may also include
`Optional` dictionary values.
These changes update the type annotations for `combine_score_weights` to
reflect this fact.
* 🏷 Fix tokenizer serialization method signatures in `DummyTokenizer`
* 🏷 Fix redefinition of `wandb_logger`
These changes fix the redefinition of `wandb_logger` by giving a
separate name to each `WandbLogger` version. For
backwards-compatibility, `spacy.train` still exports `wandb_logger_v3`
as `wandb_logger` for now.
* more fixes for typing in language
* type fixes in model definitions
* 🏷 Annotate `_RandomWords.probs` as `NDArray`
* 🏷 Annotate `tok2vec` layers to help Mypy
* 🐛 Fix `_RandomWords.probs` type annotations for Python 3.6
Also remove an import that I forgot to move to the top of the module 😅
* more fixes for matchers and other pipeline components
* quick fix for entity linker
* fixing types for spancat, textcat, etc
* bugfix for tok2vec
* type annotations for scorer
* add runtime_checkable for Protocol
* type and import fixes in tests
* mypy fixes for training utilities
* few fixes in util
* fix import
* 🐵 Remove unused `# type: ignore` directives
* 🏷 Annotate `Language._components`
* 🏷 Annotate `spacy.pipeline.Pipe`
* add doc as property to span.pyi
* small fixes and cleanup
* explicit type annotations instead of via comment
Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
Co-authored-by: svlandeg <sofie.vanlandeghem@gmail.com>
Co-authored-by: svlandeg <svlandeg@github.com>
2021-10-14 16:21:40 +03:00
|
|
|
allow_redefinition = True
|