Compare commits
164 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62278c5138 | |||
| 5613242988 | |||
| c5161d61b6 | |||
| 0b43518611 | |||
| 7a7f191220 | |||
| e5910847a9 | |||
| 5056e6b3cf | |||
| 54791f664f | |||
| 95d56aad14 | |||
| c2e424347f | |||
| a60be278e4 | |||
| 2e1afb740e | |||
| 375a466784 | |||
| fb2151c505 | |||
| 3577bf5b3d | |||
| 5cf338b480 | |||
| bdbf1cb30e | |||
| b90e33469e | |||
| 573b2f2c09 | |||
| 1f94cecc33 | |||
| 1e0cc44994 | |||
| 04ad6d179a | |||
| b33123f5a2 | |||
| 01a1bce560 | |||
| c5d0f1e376 | |||
| c39596aabb | |||
| 0c46b69022 | |||
| e1249d3722 | |||
| 40422ff904 | |||
| 2dbb332cea | |||
| d84068e460 | |||
| 89a43f39b7 | |||
| 9b1b091b1a | |||
| 259b9dd593 | |||
| c749eb5570 | |||
| 465848cbc6 | |||
| 2b4d652d0d | |||
| 9a05247690 | |||
| 2ccf0d5a6a | |||
| 252ad2adb8 | |||
| fc5cd57869 | |||
| 0f9c3edf7f | |||
| 2492b0ec31 | |||
| 8897621db9 | |||
| b627f952bb | |||
| 5874ec5521 | |||
| 5e1d39822d | |||
| 08e9ca5a7d | |||
| 6f8804f1b8 | |||
| 51751f93f4 | |||
| 7ee846b992 | |||
| a1725fe2b3 | |||
| d6bcb226f6 | |||
| 63f7df8a1c | |||
| fb59288d1c | |||
| 5abb9d5791 | |||
| 1c0205967d | |||
| 807f36eaa1 | |||
| 642a4de63f | |||
| d501b819ce | |||
| 238434b6b4 | |||
| 117c8f1e0e | |||
| 439a5165a6 | |||
| ea2bb91e9b | |||
| 47a2b58af2 | |||
| 94c390d349 | |||
| a20f54fb91 | |||
| 0ea7e22ba8 | |||
| 827cea6fc3 | |||
| 5027b7d0a8 | |||
| 4341881a05 | |||
| d729a61a7d | |||
| 0d68d5bc33 | |||
| 21e47853b4 | |||
| 58c54916f4 | |||
| 763e0b4106 | |||
| 29c0c76448 | |||
| afe03898ed | |||
| c772481b37 | |||
| 5660261321 | |||
| 5e4fdfc233 | |||
| 88ba050b76 | |||
| aaadd22941 | |||
| 1eb2de5ccf | |||
| 4f5dd710b9 | |||
| 756aa55c63 | |||
| da60d4243e | |||
| 4b3618bcb4 | |||
| 3fd447a13f | |||
| 3c3c309499 | |||
| d574166326 | |||
| 8f7066ff7d | |||
| c6a9690ab5 | |||
| 1424007b80 | |||
| a024126276 | |||
| 4223524315 | |||
| defe12dc7f | |||
| 483019c385 | |||
| 80d8825ce2 | |||
| 0d50d8676b | |||
| 9e660fa115 | |||
| 98c289a544 | |||
| 8249ce3947 | |||
| 027812a914 | |||
| ebabd90ae5 | |||
| 215c86955e | |||
| 08e9f2b98e | |||
| 0cd5980b53 | |||
| 5a9c8aef8f | |||
| c48024159d | |||
| f08eedb89d | |||
| 4d0fb098ee | |||
| 8153bd573f | |||
| 83056bb44c | |||
| 03b320b3bd | |||
| c2810575c0 | |||
| 53687b5bca | |||
| 5398e9f276 | |||
| 69ca6eb041 | |||
| cbd85c9608 | |||
| a1fc4ed962 | |||
| 6177c87539 | |||
| a86ec1b2b1 | |||
| e381efd936 | |||
| a2b232a7a1 | |||
| 6f1632b3e9 | |||
| e325de3ff8 | |||
| b3e7364551 | |||
| f87919d8f0 | |||
| 5b9522d83d | |||
| 7261d724c6 | |||
| 5ed1db7ae4 | |||
| 18f4378a91 | |||
| be673462be | |||
| dce0671a26 | |||
| 14b27eebe2 | |||
| 3cf3483426 | |||
| 20b00af067 | |||
| c4e337a505 | |||
| ddc191f2a8 | |||
| f0c5f0af6a | |||
| dc68b70210 | |||
| e6a5840c68 | |||
| 9a6fb3a080 | |||
| c53944754b | |||
| 77b8c6d0e7 | |||
| 8101c84901 | |||
| f1ffcd239c | |||
| 0ad9c8864d | |||
| 32935c5ad5 | |||
| de2c5af82a | |||
| e18c70f65c | |||
| 3f372b2a7a | |||
| f288844805 | |||
| fe06d8a0dd | |||
| d87af5e6f4 | |||
| 56dfe060d2 | |||
| 65e49e2973 | |||
| 6fc78a8080 | |||
| 9a51fa2b6f | |||
| 0acac74174 | |||
| 469a64dfc3 | |||
| 360e1e0db5 | |||
| 57e9373ef3 |
@@ -9,7 +9,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: [master, v4]
|
||||
branch: [master, main]
|
||||
if: github.repository_owner == 'explosion'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
branch: [master, v4]
|
||||
branch: [master, main]
|
||||
if: github.repository_owner == 'explosion'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
+5
-6
@@ -449,13 +449,12 @@ and plugins in spaCy v3.0, and we can't wait to see what you build with it!
|
||||
[`spacy`](https://github.com/topics/spacy?o=desc&s=stars) and
|
||||
[`spacy-extensions`](https://github.com/topics/spacy-extension?o=desc&s=stars)
|
||||
to make it easier to find. Those are also the topics we're linking to from the
|
||||
spaCy website. If you're sharing your project on Twitter, feel free to tag
|
||||
[@spacy_io](https://twitter.com/spacy_io) so we can check it out.
|
||||
spaCy website. If you're sharing your project on X, feel free to tag
|
||||
[@spacy_io](https://x.com/spacy_io) so we can check it out.
|
||||
|
||||
- Once your extension is published, you can open an issue on the
|
||||
[issue tracker](https://github.com/explosion/spacy/issues) to suggest it for the
|
||||
[resources directory](https://spacy.io/usage/resources#extensions) on the
|
||||
website.
|
||||
- Once your extension is published, you can open a
|
||||
[PR](https://github.com/explosion/spaCy/pulls) to suggest it for the
|
||||
[Universe](https://spacy.io/universe) page.
|
||||
|
||||
📖 **For more tips and best practices, see the [checklist for developing spaCy extensions](https://spacy.io/usage/processing-pipelines#extensions).**
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ open-source software, released under the
|
||||
<br />
|
||||
[](https://pypi.org/project/spacy/)
|
||||
[](https://anaconda.org/conda-forge/spacy)
|
||||
[](https://twitter.com/spacy_io)
|
||||
|
||||
## 📖 Documentation
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# fmt: off
|
||||
__title__ = "spacy"
|
||||
__version__ = "3.7.2"
|
||||
__version__ = "3.7.3"
|
||||
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
|
||||
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json"
|
||||
|
||||
@@ -39,7 +39,7 @@ def find_threshold_cli(
|
||||
# fmt: on
|
||||
):
|
||||
"""
|
||||
Runs prediction trials for a trained model with varying tresholds to maximize
|
||||
Runs prediction trials for a trained model with varying thresholds to maximize
|
||||
the specified metric. The search space for the threshold is traversed linearly
|
||||
from 0 to 1 in `n_trials` steps. Results are displayed in a table on `stdout`
|
||||
(the corresponding API call to `spacy.cli.find_threshold.find_threshold()`
|
||||
@@ -81,7 +81,7 @@ def find_threshold(
|
||||
silent: bool = True,
|
||||
) -> Tuple[float, float, Dict[float, float]]:
|
||||
"""
|
||||
Runs prediction trials for models with varying tresholds to maximize the specified metric.
|
||||
Runs prediction trials for models with varying thresholds to maximize the specified metric.
|
||||
model (Union[str, Path]): Pipeline to evaluate. Can be a package or a path to a data directory.
|
||||
data_path (Path): Path to file with DocBin with docs to use for threshold search.
|
||||
pipe_name (str): Name of pipe to examine thresholds for.
|
||||
|
||||
+5
-2
@@ -1716,6 +1716,7 @@ class Language:
|
||||
# is done, so that they can exit gracefully.
|
||||
for q in texts_q:
|
||||
q.put(_WORK_DONE_SENTINEL)
|
||||
q.close()
|
||||
|
||||
# Otherwise, we are stopping because the error handler raised an
|
||||
# exception. The sentinel will be last to go out of the queue.
|
||||
@@ -2347,7 +2348,8 @@ def _apply_pipes(
|
||||
|
||||
# Stop working if we encounter the end-of-work sentinel.
|
||||
if isinstance(texts_with_ctx, _WorkDoneSentinel):
|
||||
return
|
||||
sender.close()
|
||||
receiver.close()
|
||||
|
||||
docs = (
|
||||
ensure_doc(doc_like, context) for doc_like, context in texts_with_ctx
|
||||
@@ -2371,7 +2373,8 @@ def _apply_pipes(
|
||||
# Parent has closed the pipe prematurely. This happens when a
|
||||
# worker encounters an error and the error handler is set to
|
||||
# stop processing.
|
||||
return
|
||||
sender.close()
|
||||
receiver.close()
|
||||
|
||||
|
||||
class _Sender:
|
||||
|
||||
@@ -185,6 +185,11 @@ def build_text_classifier_v2(
|
||||
|
||||
|
||||
def init_ensemble_textcat(model, X, Y) -> Model:
|
||||
# When tok2vec is lazily initialized, we need to initialize it before
|
||||
# the rest of the chain to ensure that we can get its width.
|
||||
tok2vec = model.get_ref("tok2vec")
|
||||
tok2vec.initialize(X)
|
||||
|
||||
tok2vec_width = get_tok2vec_width(model)
|
||||
model.get_ref("attention_layer").set_dim("nO", tok2vec_width)
|
||||
model.get_ref("maxout_layer").set_dim("nO", tok2vec_width)
|
||||
@@ -264,6 +269,7 @@ def _build_parametric_attention_with_residual_nonlinear(
|
||||
|
||||
parametric_attention.set_ref("tok2vec", tok2vec)
|
||||
parametric_attention.set_ref("attention_layer", attention_layer)
|
||||
parametric_attention.set_ref("key_transform", key_transform)
|
||||
parametric_attention.set_ref("nonlinear_layer", nonlinear_layer)
|
||||
parametric_attention.set_ref("norm_layer", norm_layer)
|
||||
|
||||
@@ -271,10 +277,17 @@ def _build_parametric_attention_with_residual_nonlinear(
|
||||
|
||||
|
||||
def _init_parametric_attention_with_residual_nonlinear(model, X, Y) -> Model:
|
||||
# When tok2vec is lazily initialized, we need to initialize it before
|
||||
# the rest of the chain to ensure that we can get its width.
|
||||
tok2vec = model.get_ref("tok2vec")
|
||||
tok2vec.initialize(X)
|
||||
|
||||
tok2vec_width = get_tok2vec_width(model)
|
||||
model.get_ref("attention_layer").set_dim("nO", tok2vec_width)
|
||||
model.get_ref("nonlinear_layer").set_dim("nO", tok2vec_width)
|
||||
model.get_ref("key_transform").set_dim("nI", tok2vec_width)
|
||||
model.get_ref("key_transform").set_dim("nO", tok2vec_width)
|
||||
model.get_ref("nonlinear_layer").set_dim("nI", tok2vec_width)
|
||||
model.get_ref("nonlinear_layer").set_dim("nO", tok2vec_width)
|
||||
model.get_ref("norm_layer").set_dim("nI", tok2vec_width)
|
||||
model.get_ref("norm_layer").set_dim("nO", tok2vec_width)
|
||||
init_chain(model, X, Y)
|
||||
|
||||
@@ -28,6 +28,8 @@ from spacy.tokens import Doc, DocBin
|
||||
from spacy.training import Example
|
||||
from spacy.training.initialize import init_nlp
|
||||
|
||||
# Ensure that the architecture gets added to the registry.
|
||||
from ..tok2vec import build_lazy_init_tok2vec as _
|
||||
from ..util import make_tempdir
|
||||
|
||||
TRAIN_DATA_SINGLE_LABEL = [
|
||||
@@ -40,6 +42,13 @@ TRAIN_DATA_MULTI_LABEL = [
|
||||
("I'm confused but happy", {"cats": {"ANGRY": 0.0, "CONFUSED": 1.0, "HAPPY": 1.0}}),
|
||||
]
|
||||
|
||||
lazy_init_model_config = """
|
||||
[model]
|
||||
@architectures = "test.LazyInitTok2Vec.v1"
|
||||
width = 96
|
||||
"""
|
||||
LAZY_INIT_TOK2VEC_MODEL = Config().from_str(lazy_init_model_config)["model"]
|
||||
|
||||
|
||||
def make_get_examples_single_label(nlp):
|
||||
train_examples = []
|
||||
@@ -546,6 +555,34 @@ def test_error_with_multi_labels():
|
||||
nlp.initialize(get_examples=lambda: train_examples)
|
||||
|
||||
|
||||
# fmt: off
|
||||
@pytest.mark.parametrize(
|
||||
"name,textcat_config",
|
||||
[
|
||||
# ENSEMBLE V2
|
||||
("textcat_multilabel", {"@architectures": "spacy.TextCatEnsemble.v2", "tok2vec": LAZY_INIT_TOK2VEC_MODEL, "linear_model": {"@architectures": "spacy.TextCatBOW.v3", "exclusive_classes": False, "ngram_size": 1, "no_output_layer": False}}),
|
||||
("textcat", {"@architectures": "spacy.TextCatEnsemble.v2", "tok2vec": LAZY_INIT_TOK2VEC_MODEL, "linear_model": {"@architectures": "spacy.TextCatBOW.v3", "exclusive_classes": True, "ngram_size": 5, "no_output_layer": False}}),
|
||||
# PARAMETRIC ATTENTION V1
|
||||
("textcat", {"@architectures": "spacy.TextCatParametricAttention.v1", "tok2vec": LAZY_INIT_TOK2VEC_MODEL, "exclusive_classes": True}),
|
||||
("textcat_multilabel", {"@architectures": "spacy.TextCatParametricAttention.v1", "tok2vec": LAZY_INIT_TOK2VEC_MODEL, "exclusive_classes": False}),
|
||||
# REDUCE
|
||||
("textcat", {"@architectures": "spacy.TextCatReduce.v1", "tok2vec": LAZY_INIT_TOK2VEC_MODEL, "exclusive_classes": True, "use_reduce_first": True, "use_reduce_last": True, "use_reduce_max": True, "use_reduce_mean": True}),
|
||||
("textcat_multilabel", {"@architectures": "spacy.TextCatReduce.v1", "tok2vec": LAZY_INIT_TOK2VEC_MODEL, "exclusive_classes": False, "use_reduce_first": True, "use_reduce_last": True, "use_reduce_max": True, "use_reduce_mean": True}),
|
||||
],
|
||||
)
|
||||
# fmt: on
|
||||
def test_tok2vec_lazy_init(name, textcat_config):
|
||||
# Check that we can properly initialize and use a textcat model using
|
||||
# a lazily-initialized tok2vec.
|
||||
nlp = English()
|
||||
pipe_config = {"model": textcat_config}
|
||||
textcat = nlp.add_pipe(name, config=pipe_config)
|
||||
textcat.add_label("POSITIVE")
|
||||
textcat.add_label("NEGATIVE")
|
||||
nlp.initialize()
|
||||
nlp.pipe(["This is a test."])
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"name,get_examples, train_data",
|
||||
[
|
||||
|
||||
@@ -328,7 +328,7 @@ def test_language_pipe_error_handler(n_process):
|
||||
nlp.set_error_handler(raise_error)
|
||||
with pytest.raises(ValueError):
|
||||
list(nlp.pipe(texts, n_process=n_process))
|
||||
# set explicitely to ignoring
|
||||
# set explicitly to ignoring
|
||||
nlp.set_error_handler(ignore_error)
|
||||
docs = list(nlp.pipe(texts, n_process=n_process))
|
||||
assert len(docs) == 0
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
from typing import List
|
||||
|
||||
from thinc.api import Model
|
||||
from thinc.types import Floats2d
|
||||
|
||||
from spacy.tokens import Doc
|
||||
from spacy.util import registry
|
||||
|
||||
|
||||
@registry.architectures("test.LazyInitTok2Vec.v1")
|
||||
def build_lazy_init_tok2vec(*, width: int) -> Model[List[Doc], List[Floats2d]]:
|
||||
"""tok2vec model of which the output size is only known after
|
||||
initialization. This implementation does not output meaningful
|
||||
embeddings, it is strictly for testing."""
|
||||
return Model(
|
||||
"lazy_init_tok2vec",
|
||||
lazy_init_tok2vec_forward,
|
||||
init=lazy_init_tok2vec_init,
|
||||
dims={"nO": None},
|
||||
attrs={"width": width},
|
||||
)
|
||||
|
||||
|
||||
def lazy_init_tok2vec_init(model: Model, X=None, Y=None):
|
||||
width = model.attrs["width"]
|
||||
model.set_dim("nO", width)
|
||||
|
||||
|
||||
def lazy_init_tok2vec_forward(model: Model, X: List[Doc], is_train: bool):
|
||||
width = model.get_dim("nO")
|
||||
Y = [model.ops.alloc2f(len(doc), width) for doc in X]
|
||||
|
||||
def backprop(dY):
|
||||
return []
|
||||
|
||||
return Y, backprop
|
||||
@@ -45,33 +45,33 @@ For attributes that represent string values, the internal integer ID is accessed
|
||||
as `Token.attr`, e.g. `token.dep`, while the string value can be retrieved by
|
||||
appending `_` as in `token.dep_`.
|
||||
|
||||
| Attribute | Description |
|
||||
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `DEP` | The token's dependency label. ~~str~~ |
|
||||
| `ENT_ID` | The token's entity ID (`ent_id`). ~~str~~ |
|
||||
| `ENT_IOB` | The IOB part of the token's entity tag. Uses custom integer vaues rather than the string store: unset is `0`, `I` is `1`, `O` is `2`, and `B` is `3`. ~~str~~ |
|
||||
| `ENT_KB_ID` | The token's entity knowledge base ID. ~~str~~ |
|
||||
| `ENT_TYPE` | The token's entity label. ~~str~~ |
|
||||
| `IS_ALPHA` | Token text consists of alphabetic characters. ~~bool~~ |
|
||||
| `IS_ASCII` | Token text consists of ASCII characters. ~~bool~~ |
|
||||
| `IS_DIGIT` | Token text consists of digits. ~~bool~~ |
|
||||
| `IS_LOWER` | Token text is in lowercase. ~~bool~~ |
|
||||
| `IS_PUNCT` | Token is punctuation. ~~bool~~ |
|
||||
| `IS_SPACE` | Token is whitespace. ~~bool~~ |
|
||||
| `IS_STOP` | Token is a stop word. ~~bool~~ |
|
||||
| `IS_TITLE` | Token text is in titlecase. ~~bool~~ |
|
||||
| `IS_UPPER` | Token text is in uppercase. ~~bool~~ |
|
||||
| `LEMMA` | The token's lemma. ~~str~~ |
|
||||
| `LENGTH` | The length of the token text. ~~int~~ |
|
||||
| `LIKE_EMAIL` | Token text resembles an email address. ~~bool~~ |
|
||||
| `LIKE_NUM` | Token text resembles a number. ~~bool~~ |
|
||||
| `LIKE_URL` | Token text resembles a URL. ~~bool~~ |
|
||||
| `LOWER` | The lowercase form of the token text. ~~str~~ |
|
||||
| `MORPH` | The token's morphological analysis. ~~MorphAnalysis~~ |
|
||||
| `NORM` | The normalized form of the token text. ~~str~~ |
|
||||
| `ORTH` | The exact verbatim text of a token. ~~str~~ |
|
||||
| `POS` | The token's universal part of speech (UPOS). ~~str~~ |
|
||||
| `SENT_START` | Token is start of sentence. ~~bool~~ |
|
||||
| `SHAPE` | The token's shape. ~~str~~ |
|
||||
| `SPACY` | Token has a trailing space. ~~bool~~ |
|
||||
| `TAG` | The token's fine-grained part of speech. ~~str~~ |
|
||||
| Attribute | Description |
|
||||
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `DEP` | The token's dependency label. ~~str~~ |
|
||||
| `ENT_ID` | The token's entity ID (`ent_id`). ~~str~~ |
|
||||
| `ENT_IOB` | The IOB part of the token's entity tag. Uses custom integer values rather than the string store: unset is `0`, `I` is `1`, `O` is `2`, and `B` is `3`. ~~str~~ |
|
||||
| `ENT_KB_ID` | The token's entity knowledge base ID. ~~str~~ |
|
||||
| `ENT_TYPE` | The token's entity label. ~~str~~ |
|
||||
| `IS_ALPHA` | Token text consists of alphabetic characters. ~~bool~~ |
|
||||
| `IS_ASCII` | Token text consists of ASCII characters. ~~bool~~ |
|
||||
| `IS_DIGIT` | Token text consists of digits. ~~bool~~ |
|
||||
| `IS_LOWER` | Token text is in lowercase. ~~bool~~ |
|
||||
| `IS_PUNCT` | Token is punctuation. ~~bool~~ |
|
||||
| `IS_SPACE` | Token is whitespace. ~~bool~~ |
|
||||
| `IS_STOP` | Token is a stop word. ~~bool~~ |
|
||||
| `IS_TITLE` | Token text is in titlecase. ~~bool~~ |
|
||||
| `IS_UPPER` | Token text is in uppercase. ~~bool~~ |
|
||||
| `LEMMA` | The token's lemma. ~~str~~ |
|
||||
| `LENGTH` | The length of the token text. ~~int~~ |
|
||||
| `LIKE_EMAIL` | Token text resembles an email address. ~~bool~~ |
|
||||
| `LIKE_NUM` | Token text resembles a number. ~~bool~~ |
|
||||
| `LIKE_URL` | Token text resembles a URL. ~~bool~~ |
|
||||
| `LOWER` | The lowercase form of the token text. ~~str~~ |
|
||||
| `MORPH` | The token's morphological analysis. ~~MorphAnalysis~~ |
|
||||
| `NORM` | The normalized form of the token text. ~~str~~ |
|
||||
| `ORTH` | The exact verbatim text of a token. ~~str~~ |
|
||||
| `POS` | The token's universal part of speech (UPOS). ~~str~~ |
|
||||
| `SENT_START` | Token is start of sentence. ~~bool~~ |
|
||||
| `SHAPE` | The token's shape. ~~str~~ |
|
||||
| `SPACY` | Token has a trailing space. ~~bool~~ |
|
||||
| `TAG` | The token's fine-grained part of speech. ~~str~~ |
|
||||
|
||||
@@ -567,7 +567,7 @@ New: 'ORG' (23860), 'PERSON' (21395), 'GPE' (21193), 'DATE' (18080), 'CARDINAL'
|
||||
'LOC' (2113), 'TIME' (1616), 'WORK_OF_ART' (1229), 'QUANTITY' (1150), 'FAC'
|
||||
(1134), 'EVENT' (974), 'PRODUCT' (935), 'LAW' (444), 'LANGUAGE' (338)
|
||||
✔ Good amount of examples for all labels
|
||||
✔ Examples without occurences available for all labels
|
||||
✔ Examples without occurrences available for all labels
|
||||
✔ No entities consisting of or starting/ending with whitespace
|
||||
|
||||
=========================== Part-of-speech Tagging ===========================
|
||||
@@ -1320,7 +1320,7 @@ $ python -m spacy apply [model] [data-path] [output-file] [--code] [--text-key]
|
||||
|
||||
## find-threshold {id="find-threshold",version="3.5",tag="command"}
|
||||
|
||||
Runs prediction trials for a trained model with varying tresholds to maximize
|
||||
Runs prediction trials for a trained model with varying thresholds to maximize
|
||||
the specified metric. The search space for the threshold is traversed linearly
|
||||
from 0 to 1 in `n_trials` steps. Results are displayed in a table on `stdout`
|
||||
(the corresponding API call to `spacy.cli.find_threshold.find_threshold()`
|
||||
|
||||
@@ -67,7 +67,7 @@ architectures and their arguments and hyperparameters.
|
||||
| `generate_empty_kb` <Tag variant="new">3.5.1</Tag> | Function that generates an empty `KnowledgeBase` object. Defaults to [`spacy.EmptyKB.v2`](/api/architectures#EmptyKB), which generates an empty [`InMemoryLookupKB`](/api/inmemorylookupkb). ~~Callable[[Vocab, int], KnowledgeBase]~~ |
|
||||
| `overwrite` <Tag variant="new">3.2</Tag> | Whether existing annotation is overwritten. Defaults to `True`. ~~bool~~ |
|
||||
| `scorer` <Tag variant="new">3.2</Tag> | The scoring method. Defaults to [`Scorer.score_links`](/api/scorer#score_links). ~~Optional[Callable]~~ |
|
||||
| `threshold` <Tag variant="new">3.4</Tag> | Confidence threshold for entity predictions. The default of `None` implies that all predictions are accepted, otherwise those with a score beneath the treshold are discarded. If there are no predictions with scores above the threshold, the linked entity is `NIL`. ~~Optional[float]~~ |
|
||||
| `threshold` <Tag variant="new">3.4</Tag> | Confidence threshold for entity predictions. The default of `None` implies that all predictions are accepted, otherwise those with a score beneath the threshold are discarded. If there are no predictions with scores above the threshold, the linked entity is `NIL`. ~~Optional[float]~~ |
|
||||
|
||||
```python
|
||||
%%GITHUB_SPACY/spacy/pipeline/entity_linker.py
|
||||
@@ -100,21 +100,21 @@ custom knowledge base, you should either call
|
||||
[`set_kb`](/api/entitylinker#set_kb) or provide a `kb_loader` in the
|
||||
[`initialize`](/api/entitylinker#initialize) call.
|
||||
|
||||
| Name | Description |
|
||||
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `vocab` | The shared vocabulary. ~~Vocab~~ |
|
||||
| `model` | The [`Model`](https://thinc.ai/docs/api-model) powering the pipeline component. ~~Model~~ |
|
||||
| `name` | String name of the component instance. Used to add entries to the `losses` during training. ~~str~~ |
|
||||
| _keyword-only_ | |
|
||||
| `entity_vector_length` | Size of encoding vectors in the KB. ~~int~~ |
|
||||
| `get_candidates` | Function that generates plausible candidates for a given `Span` object. ~~Callable[[KnowledgeBase, Span], Iterable[Candidate]]~~ |
|
||||
| `labels_discard` | NER labels that will automatically get a `"NIL"` prediction. ~~Iterable[str]~~ |
|
||||
| `n_sents` | The number of neighbouring sentences to take into account. ~~int~~ |
|
||||
| `incl_prior` | Whether or not to include prior probabilities from the KB in the model. ~~bool~~ |
|
||||
| `incl_context` | Whether or not to include the local context in the model. ~~bool~~ |
|
||||
| `overwrite` <Tag variant="new">3.2</Tag> | Whether existing annotation is overwritten. Defaults to `True`. ~~bool~~ |
|
||||
| `scorer` <Tag variant="new">3.2</Tag> | The scoring method. Defaults to [`Scorer.score_links`](/api/scorer#score_links). ~~Optional[Callable]~~ |
|
||||
| `threshold` <Tag variant="new">3.4</Tag> | Confidence threshold for entity predictions. The default of `None` implies that all predictions are accepted, otherwise those with a score beneath the treshold are discarded. If there are no predictions with scores above the threshold, the linked entity is `NIL`. ~~Optional[float]~~ |
|
||||
| Name | Description |
|
||||
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `vocab` | The shared vocabulary. ~~Vocab~~ |
|
||||
| `model` | The [`Model`](https://thinc.ai/docs/api-model) powering the pipeline component. ~~Model~~ |
|
||||
| `name` | String name of the component instance. Used to add entries to the `losses` during training. ~~str~~ |
|
||||
| _keyword-only_ | |
|
||||
| `entity_vector_length` | Size of encoding vectors in the KB. ~~int~~ |
|
||||
| `get_candidates` | Function that generates plausible candidates for a given `Span` object. ~~Callable[[KnowledgeBase, Span], Iterable[Candidate]]~~ |
|
||||
| `labels_discard` | NER labels that will automatically get a `"NIL"` prediction. ~~Iterable[str]~~ |
|
||||
| `n_sents` | The number of neighbouring sentences to take into account. ~~int~~ |
|
||||
| `incl_prior` | Whether or not to include prior probabilities from the KB in the model. ~~bool~~ |
|
||||
| `incl_context` | Whether or not to include the local context in the model. ~~bool~~ |
|
||||
| `overwrite` <Tag variant="new">3.2</Tag> | Whether existing annotation is overwritten. Defaults to `True`. ~~bool~~ |
|
||||
| `scorer` <Tag variant="new">3.2</Tag> | The scoring method. Defaults to [`Scorer.score_links`](/api/scorer#score_links). ~~Optional[Callable]~~ |
|
||||
| `threshold` <Tag variant="new">3.4</Tag> | Confidence threshold for entity predictions. The default of `None` implies that all predictions are accepted, otherwise those with a score beneath the threshold are discarded. If there are no predictions with scores above the threshold, the linked entity is `NIL`. ~~Optional[float]~~ |
|
||||
|
||||
## EntityLinker.\_\_call\_\_ {id="call",tag="method"}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ how the component should be configured. You can override its settings via the
|
||||
| Setting | Description |
|
||||
| ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `phrase_matcher_attr` | Optional attribute name match on for the internal [`PhraseMatcher`](/api/phrasematcher), e.g. `LOWER` to match on the lowercase token text. Defaults to `None`. ~~Optional[Union[int, str]]~~ |
|
||||
| `matcher_fuzzy_compare` <Tag variant="new">3.5</Tag> | The fuzzy comparison method, passed on to the internal `Matcher`. Defaults to `spacy.matcher.levenshtein.levenshtein_compare`. ~~Callable~~ |
|
||||
| `matcher_fuzzy_compare` <Tag variant="new">3.5</Tag> | The fuzzy comparison method, passed on to the internal `Matcher`. Defaults to `spacy.matcher.levenshtein.levenshtein_compare`. ~~Callable~~ |
|
||||
| `validate` | Whether patterns should be validated (passed to the `Matcher` and `PhraseMatcher`). Defaults to `False`. ~~bool~~ |
|
||||
| `overwrite_ents` | If existing entities are present, e.g. entities added by the model, overwrite them by matches if necessary. Defaults to `False`. ~~bool~~ |
|
||||
| `ent_id_sep` | Separator used internally for entity IDs. Defaults to `"\|\|"`. ~~str~~ |
|
||||
@@ -92,7 +92,7 @@ be a token pattern (list) or a phrase pattern (string). For example:
|
||||
| `name` <Tag variant="new">3</Tag> | Instance name of the current pipeline component. Typically passed in automatically from the factory when the component is added. Used to disable the current entity ruler while creating phrase patterns with the nlp object. ~~str~~ |
|
||||
| _keyword-only_ | |
|
||||
| `phrase_matcher_attr` | Optional attribute name match on for the internal [`PhraseMatcher`](/api/phrasematcher), e.g. `LOWER` to match on the lowercase token text. Defaults to `None`. ~~Optional[Union[int, str]]~~ |
|
||||
| `matcher_fuzzy_compare` <Tag variant="new">3.5</Tag> | The fuzzy comparison method, passed on to the internal `Matcher`. Defaults to `spacy.matcher.levenshtein.levenshtein_compare`. ~~Callable~~ |
|
||||
| `matcher_fuzzy_compare` <Tag variant="new">3.5</Tag> | The fuzzy comparison method, passed on to the internal `Matcher`. Defaults to `spacy.matcher.levenshtein.levenshtein_compare`. ~~Callable~~ |
|
||||
| `validate` | Whether patterns should be validated, passed to Matcher and PhraseMatcher as `validate`. Defaults to `False`. ~~bool~~ |
|
||||
| `overwrite_ents` | If existing entities are present, e.g. entities added by the model, overwrite them by matches if necessary. Defaults to `False`. ~~bool~~ |
|
||||
| `ent_id_sep` | Separator used internally for entity IDs. Defaults to `"\|\|"`. ~~str~~ |
|
||||
@@ -173,7 +173,7 @@ happens automatically after the component has been added to the pipeline using
|
||||
[`nlp.add_pipe`](/api/language#add_pipe). If the entity ruler was initialized
|
||||
with `overwrite_ents=True`, existing entities will be replaced if they overlap
|
||||
with the matches. When matches overlap in a Doc, the entity ruler prioritizes
|
||||
longer patterns over shorter, and if equal the match occuring first in the Doc
|
||||
longer patterns over shorter, and if equal the match occurring first in the Doc
|
||||
is chosen.
|
||||
|
||||
> #### Example
|
||||
|
||||
@@ -890,6 +890,28 @@ when loading a config with
|
||||
| `pipe_name` | Name of pipeline component to replace listeners for. ~~str~~ |
|
||||
| `listeners` | The paths to the listeners, relative to the component config, e.g. `["model.tok2vec"]`. Typically, implementations will only connect to one tok2vec component, `model.tok2vec`, but in theory, custom models can use multiple listeners. The value here can either be an empty list to not replace any listeners, or a _complete_ list of the paths to all listener layers used by the model that should be replaced.~~Iterable[str]~~ |
|
||||
|
||||
## Language.memory_zone {id="memory_zone",tag="contextmanager",version="3.8"}
|
||||
|
||||
Begin a block where all resources allocated during the block will be freed at
|
||||
the end of it. If a resources was created within the memory zone block,
|
||||
accessing it outside the block is invalid. Behavior of this invalid access is
|
||||
undefined. Memory zones should not be nested. The memory zone is helpful for
|
||||
services that need to process large volumes of text with a defined memory budget.
|
||||
|
||||
> ```python
|
||||
> ### Example
|
||||
> counts = Counter()
|
||||
> with nlp.memory_zone():
|
||||
> for doc in nlp.pipe(texts):
|
||||
> for token in doc:
|
||||
> counts[token.text] += 1
|
||||
> ```
|
||||
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| `mem` | Optional `cymem.Pool` object to own allocations (created if not provided). This argument is not required for ordinary usage. Defaults to `None`. ~~Optional[cymem.Pool]~~ |
|
||||
| **RETURNS** | The memory pool that owns the allocations. This object is not required for ordinary usage. ~~Iterator[cymem.Pool]~~ |
|
||||
|
||||
## Language.meta {id="meta",tag="property"}
|
||||
|
||||
Meta data for the `Language` class, including name, version, data sources,
|
||||
|
||||
@@ -1597,7 +1597,7 @@ The name of the model to be used has to be passed in via the `name` attribute.
|
||||
|
||||
| Argument | Description |
|
||||
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `name` | The name of a mdodel supported by LangChain for this API. ~~str~~ |
|
||||
| `name` | The name of a model supported by LangChain for this API. ~~str~~ |
|
||||
| `config` | Configuration passed on to the LangChain model. Defaults to `{}`. ~~Dict[Any, Any]~~ |
|
||||
| `query` | Function that executes the prompts. If `None`, defaults to `spacy.CallLangChain.v1`. ~~Optional[Callable[["langchain.llms.BaseLLM", Iterable[Any]], Iterable[Any]]]~~ |
|
||||
|
||||
|
||||
@@ -147,9 +147,10 @@ Whether a feature/value pair is in the analysis.
|
||||
> assert "Feat1=Val1" in morph
|
||||
> ```
|
||||
|
||||
| Name | Description |
|
||||
| ----------- | --------------------------------------------- |
|
||||
| **RETURNS** | A feature/value pair in the analysis. ~~str~~ |
|
||||
| Name | Description |
|
||||
| ------------ | --------------------------------------------------------------------- |
|
||||
| `feature` | A feature/value pair. ~~str~~ |
|
||||
| **RETURNS** | Whether the feature/value pair is contained in the analysis. ~~bool~~ |
|
||||
|
||||
### MorphAnalysis.\_\_iter\_\_ {id="morphanalysis-iter",tag="method"}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ it – so no NP-level coordination, no prepositional phrases, and no relative
|
||||
clauses.
|
||||
|
||||
If the `noun_chunk` [syntax iterator](/usage/linguistic-features#language-data)
|
||||
has not been implemeted for the given language, a `NotImplementedError` is
|
||||
has not been implemented for the given language, a `NotImplementedError` is
|
||||
raised.
|
||||
|
||||
> #### Example
|
||||
|
||||
@@ -416,7 +416,7 @@ by this class. Instances of this class are typically assigned to the
|
||||
| `align` | Alignment from the `Doc`'s tokenization to the wordpieces. This is a ragged array, where `align.lengths[i]` indicates the number of wordpiece tokens that token `i` aligns against. The actual indices are provided at `align[i].dataXd`. ~~Ragged~~ |
|
||||
| `width` | The width of the last hidden layer. ~~int~~ |
|
||||
|
||||
### TransformerData.empty {id="transformerdata-emoty",tag="classmethod"}
|
||||
### TransformerData.empty {id="transformerdata-empty",tag="classmethod"}
|
||||
|
||||
Create an empty `TransformerData` container.
|
||||
|
||||
|
||||
@@ -832,7 +832,7 @@ retrieve and add to them.
|
||||
|
||||
After creation, the component needs to be
|
||||
[initialized](/usage/training#initialization). This method can define the
|
||||
relevant labels in two ways: explicitely by setting the `labels` argument in the
|
||||
relevant labels in two ways: explicitly by setting the `labels` argument in the
|
||||
[`initialize` block](/api/data-formats#config-initialize) of the config, or
|
||||
implicately by deducing them from the `get_examples` callback that generates the
|
||||
full **training data set**, or a representative sample.
|
||||
|
||||
@@ -1899,7 +1899,7 @@ the two words.
|
||||
"Shore": ("coast", 0.732257),
|
||||
"Precautionary": ("caution", 0.490973),
|
||||
"hopelessness": ("sadness", 0.742366),
|
||||
"Continous": ("continuous", 0.732549),
|
||||
"Continuous": ("continuous", 0.732549),
|
||||
"Disemboweled": ("corpse", 0.499432),
|
||||
"biostatistician": ("scientist", 0.339724),
|
||||
"somewheres": ("somewheres", 0.402736),
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
---
|
||||
title: Memory Management
|
||||
teaser: Managing Memory for persistent services
|
||||
version: 3.8
|
||||
menu:
|
||||
- ['Memory Zones', 'memoryzones']
|
||||
- ['Clearing Doc attributes', 'doc-attrs']
|
||||
---
|
||||
|
||||
spaCy maintains a few internal caches that improve speed,
|
||||
but cause memory to increase slightly over time. If you're
|
||||
running a batch process that you don't need to be long-lived,
|
||||
the increase in memory usage generally isn't a problem.
|
||||
However, if you're running spaCy inside a web service, you'll
|
||||
often want spaCy's memory usage to stay consistent. Transformer
|
||||
models can also run into memory problems sometimes, especially when
|
||||
used on a GPU.
|
||||
|
||||
## Memory zones {id="memoryzones"}
|
||||
|
||||
You can tell spaCy to free data from its internal caches (especially the
|
||||
[`Vocab`](/api/vocab)) using the [`Language.memory_zone`](/api/language#memory_zone) context manager. Enter
|
||||
the contextmanager and process your text within it, and spaCy will
|
||||
**reset its internal caches** (freeing up the associated memory) at the
|
||||
end of the block. spaCy objects created inside the memory zone must
|
||||
not be accessed once the memory zone is finished.
|
||||
|
||||
```python
|
||||
### Using memory zones
|
||||
from collections import Counter
|
||||
|
||||
def count_words(nlp, texts):
|
||||
counts = Counter()
|
||||
with nlp.memory_zone():
|
||||
for doc in nlp.pipe(texts):
|
||||
for token in doc:
|
||||
counts[token.text] += 1
|
||||
return counts
|
||||
```
|
||||
|
||||
<Infobox title="Important note" variant="warning">
|
||||
|
||||
Exiting the memory-zone invalidates all `Doc`, `Token`, `Span` and `Lexeme`
|
||||
objects that were created within it. If you access these objects
|
||||
after the memory zone exits, you may encounter a segmentation fault
|
||||
due to invalid memory access.
|
||||
|
||||
</Infobox>
|
||||
|
||||
spaCy needs the memory zone contextmanager because the processing pipeline
|
||||
can't keep track of which [`Doc`](/api/doc) objects are referring to data in the shared
|
||||
[`Vocab`](/api/vocab) cache. For instance, when spaCy encounters a new word, a new [`Lexeme`](/api/lexeme)
|
||||
entry is stored in the `Vocab`, and the `Doc` object points to this shared
|
||||
data. When the `Doc` goes out of scope, the `Vocab` has no way of knowing that
|
||||
this `Lexeme` is no longer in use.
|
||||
|
||||
The memory zone solves this problem by
|
||||
allowing you to tell the processing pipeline that all data created
|
||||
between two points is no longer in use. It is up to the you to honor
|
||||
this agreement. If you access objects that are supposed to no longer be in
|
||||
use, you may encounter a segmentation fault due to invalid memory access.
|
||||
|
||||
A common use case for memory zones will be **within a web service**. The processing
|
||||
pipeline can be loaded once, either as a context variable or a global, and each
|
||||
request can be handled within a memory zone:
|
||||
|
||||
```python
|
||||
### Memory zones with FastAPI {highlight="10,23"}
|
||||
from fastapi import FastAPI, APIRouter, Depends, Request
|
||||
import spacy
|
||||
from spacy.language import Language
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
def make_app():
|
||||
app = FastAPI()
|
||||
app.state.NLP = spacy.load("en_core_web_sm")
|
||||
app.include_router(router)
|
||||
return app
|
||||
|
||||
|
||||
def get_nlp(request: Request) -> Language:
|
||||
return request.app.state.NLP
|
||||
|
||||
|
||||
@router.post("/parse")
|
||||
def parse_texts(
|
||||
*, text_batch: list[str], nlp: Language = Depends(get_nlp)
|
||||
) -> list[dict]:
|
||||
with nlp.memory_zone():
|
||||
# Put the spaCy call within a separate function, so we can't
|
||||
# leak the Doc objects outside the scope of the memory zone.
|
||||
output = _process_text(nlp, text_batch)
|
||||
return output
|
||||
|
||||
|
||||
def _process_text(nlp: Language, texts: list[str]) -> list[dict]:
|
||||
# Call spaCy, and transform the output into our own data
|
||||
# structures. This function is called from inside a memory
|
||||
# zone, so must not return the spaCy objects.
|
||||
docs = list(nlp.pipe(texts))
|
||||
return [
|
||||
{
|
||||
"tokens": [{"text": t.text} for t in doc],
|
||||
"entities": [
|
||||
{"start": e.start, "end": e.end, "label": e.label_} for e in doc.ents
|
||||
],
|
||||
}
|
||||
for doc in docs
|
||||
]
|
||||
|
||||
|
||||
app = make_app()
|
||||
```
|
||||
|
||||
## Clearing transformer tensors and other Doc attributes {id="doc-attrs"}
|
||||
|
||||
The [`Transformer`](/api/transformer) and [`Tok2Vec`](/api/tok2vec) components set intermediate values onto the `Doc`
|
||||
object during parsing. This can cause GPU memory to be exhausted if many `Doc`
|
||||
objects are kept in memory together.
|
||||
|
||||
To resolve this, you can add the [`doc_cleaner`](/api/pipeline-functions#doc_cleaner) component to your pipeline. By default
|
||||
this will clean up the [`Doc._.trf_data`](/api/transformer#custom_attributes) extension attribute and the [`Doc.tensor`](/api/doc#attributes) attribute.
|
||||
You can have it clean up other intermediate extension attributes you use in custom
|
||||
pipeline components as well.
|
||||
|
||||
```python
|
||||
### Adding the doc_cleaner
|
||||
nlp.add_pipe("doc_cleaner", config={"attrs": {"tensor": None}})
|
||||
```
|
||||
@@ -526,13 +526,17 @@ application's `requirements.txt`. If you're running your own internal PyPi
|
||||
installation, you can upload the pipeline packages there. pip's
|
||||
[requirements file format](https://pip.pypa.io/en/latest/reference/requirements-file-format/)
|
||||
supports both package names to download via a PyPi server, as well as
|
||||
[direct URLs](#pipeline-urls).
|
||||
[direct URLs](#pipeline-urls). For instance, you can specify the
|
||||
`en_core_web_sm` model for spaCy 3.7.x as follows:
|
||||
|
||||
```text {title="requirements.txt"}
|
||||
spacy>=3.0.0,<4.0.0
|
||||
en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.4.0/en_core_web_sm-3.4.0-py3-none-any.whl
|
||||
en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl
|
||||
```
|
||||
|
||||
See the [list of models](https://spacy.io/models) for model download links for
|
||||
the current spaCy version.
|
||||
|
||||
All pipeline packages are versioned and specify their spaCy dependency. This
|
||||
ensures cross-compatibility and lets you specify exact version requirements for
|
||||
each pipeline. If you've [trained](/usage/training) your own pipeline, you can
|
||||
|
||||
@@ -1719,8 +1719,7 @@ function that takes a `Doc`, modifies it and returns it.
|
||||
code on GitHub, don't forget to tag it with
|
||||
[`spacy`](https://github.com/topics/spacy?o=desc&s=stars) and
|
||||
[`spacy-extension`](https://github.com/topics/spacy-extension?o=desc&s=stars)
|
||||
to help people find it. If you post it on Twitter, feel free to tag
|
||||
[@spacy_io](https://twitter.com/spacy_io) so we can check it out.
|
||||
to help people find it.
|
||||
|
||||
### Wrapping other models and libraries {id="wrapping-models-libraries"}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ detected, a corresponding warning is displayed. If you'd like to disable the
|
||||
dependency check, set `check_requirements: false` in your project's
|
||||
`project.yml`.
|
||||
|
||||
### 4. Run a workflow {id="run-workfow"}
|
||||
### 4. Run a workflow {id="run-workflow"}
|
||||
|
||||
> #### project.yml
|
||||
>
|
||||
@@ -286,7 +286,7 @@ pipelines.
|
||||
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `title` | An optional project title used in `--help` message and [auto-generated docs](#custom-docs). |
|
||||
| `description` | An optional project description used in [auto-generated docs](#custom-docs). |
|
||||
| `vars` | A dictionary of variables that can be referenced in paths, URLs and scripts and overriden on the CLI, just like [`config.cfg` variables](/usage/training#config-interpolation). For example, `${vars.name}` will use the value of the variable `name`. Variables need to be defined in the section `vars`, but can be a nested dict, so you're able to reference `${vars.model.name}`. |
|
||||
| `vars` | A dictionary of variables that can be referenced in paths, URLs and scripts and overridden on the CLI, just like [`config.cfg` variables](/usage/training#config-interpolation). For example, `${vars.name}` will use the value of the variable `name`. Variables need to be defined in the section `vars`, but can be a nested dict, so you're able to reference `${vars.model.name}`. |
|
||||
| `env` | A dictionary of variables, mapped to the names of environment variables that will be read in when running the project. For example, `${env.name}` will use the value of the environment variable defined as `name`. |
|
||||
| `directories` | An optional list of [directories](#project-files) that should be created in the project for assets, training outputs, metrics etc. spaCy will make sure that these directories always exist. |
|
||||
| `assets` | A list of assets that can be fetched with the [`project assets`](/api/cli#project-assets) command. `url` defines a URL or local path, `dest` is the destination file relative to the project directory, and an optional `checksum` ensures that an error is raised if the file's checksum doesn't match. Instead of `url`, you can also provide a `git` block with the keys `repo`, `branch` and `path`, to download from a Git repo. |
|
||||
|
||||
@@ -720,7 +720,7 @@ matches = matcher(doc)
|
||||
|
||||
# Serve visualization of sentences containing match with displaCy
|
||||
# set manual=True to make displaCy render straight from a dictionary
|
||||
# (if you're not running the code within a Jupyer environment, you can
|
||||
# (if you're not running the code within a Jupyter environment, you can
|
||||
# use displacy.serve instead)
|
||||
displacy.render(matched_sents, style="ent", manual=True)
|
||||
```
|
||||
|
||||
@@ -306,7 +306,9 @@ installed in the same environment – that's it.
|
||||
|
||||
### Loading probability tables into existing models
|
||||
|
||||
You can load a probability table from [spacy-lookups-data](https://github.com/explosion/spacy-lookups-data) into an existing spaCy model like `en_core_web_sm`.
|
||||
You can load a probability table from
|
||||
[spacy-lookups-data](https://github.com/explosion/spacy-lookups-data) into an
|
||||
existing spaCy model like `en_core_web_sm`.
|
||||
|
||||
```python
|
||||
# Requirements: pip install spacy-lookups-data
|
||||
@@ -317,7 +319,8 @@ lookups = load_lookups("en", ["lexeme_prob"])
|
||||
nlp.vocab.lookups.add_table("lexeme_prob", lookups.get_table("lexeme_prob"))
|
||||
```
|
||||
|
||||
When training a model from scratch you can also specify probability tables in the `config.cfg`.
|
||||
When training a model from scratch you can also specify probability tables in
|
||||
the `config.cfg`.
|
||||
|
||||
```ini {title="config.cfg (excerpt)"}
|
||||
[initialize.lookups]
|
||||
@@ -346,8 +349,8 @@ them**!
|
||||
To stick with the theme of
|
||||
[this entry points blog post](https://amir.rachum.com/blog/2017/07/28/python-entry-points/),
|
||||
consider the following custom spaCy
|
||||
[pipeline component](/usage/processing-pipelines#custom-coponents) that prints a
|
||||
snake when it's called:
|
||||
[pipeline component](/usage/processing-pipelines#custom-components) that prints
|
||||
a snake when it's called:
|
||||
|
||||
> #### Package directory structure
|
||||
>
|
||||
|
||||
@@ -554,9 +554,7 @@ By participating, you are expected to uphold this code.
|
||||
|
||||
### I've built something cool with spaCy – how can I get the word out? {id="faq-project-with-spacy"}
|
||||
|
||||
First, congrats – we'd love to check it out! When you share your project on
|
||||
Twitter, don't forget to tag [@spacy_io](https://twitter.com/spacy_io) so we
|
||||
don't miss it. If you think your project would be a good fit for the
|
||||
First, congrats – we'd love to check it out! If you think your project would be a good fit for the
|
||||
[spaCy Universe](/universe), **feel free to submit it!** Tutorials are also
|
||||
incredibly valuable to other users and a great way to get exposure. So we
|
||||
strongly encourage **writing up your experiences**, or sharing your code and
|
||||
|
||||
@@ -185,7 +185,7 @@ New: 'ORG' (23860), 'PERSON' (21395), 'GPE' (21193), 'DATE' (18080), 'CARDINAL'
|
||||
'LOC' (2113), 'TIME' (1616), 'WORK_OF_ART' (1229), 'QUANTITY' (1150), 'FAC'
|
||||
(1134), 'EVENT' (974), 'PRODUCT' (935), 'LAW' (444), 'LANGUAGE' (338)
|
||||
✔ Good amount of examples for all labels
|
||||
✔ Examples without occurences available for all labels
|
||||
✔ Examples without occurrences available for all labels
|
||||
✔ No entities consisting of or starting/ending with whitespace
|
||||
|
||||
=========================== Part-of-speech Tagging ===========================
|
||||
|
||||
@@ -138,7 +138,7 @@ backwards compatibility, the tuple format remains available under
|
||||
`TransformerData.tensors` and `FullTransformerBatch.tensors`. See more details
|
||||
in the [transformer API docs](/api/architectures#TransformerModel).
|
||||
|
||||
`spacy-transfomers` v1.1 also adds support for `transformer_config` settings
|
||||
`spacy-transformers` v1.1 also adds support for `transformer_config` settings
|
||||
such as `output_attentions`. Additional output is stored under
|
||||
`TransformerData.model_output`. More details are in the
|
||||
[TransformerModel docs](/api/architectures#TransformerModel). The training speed
|
||||
|
||||
+301
-75
@@ -5,45 +5,96 @@
|
||||
{
|
||||
"label": "Get started",
|
||||
"items": [
|
||||
{ "text": "Installation", "url": "/usage" },
|
||||
{ "text": "Models & Languages", "url": "/usage/models" },
|
||||
{ "text": "Facts & Figures", "url": "/usage/facts-figures" },
|
||||
{ "text": "spaCy 101", "url": "/usage/spacy-101" },
|
||||
{ "text": "New in v3.7", "url": "/usage/v3-7" },
|
||||
{ "text": "New in v3.6", "url": "/usage/v3-6" },
|
||||
{ "text": "New in v3.5", "url": "/usage/v3-5" }
|
||||
{
|
||||
"text": "Installation",
|
||||
"url": "/usage"
|
||||
},
|
||||
{
|
||||
"text": "Models & Languages",
|
||||
"url": "/usage/models"
|
||||
},
|
||||
{
|
||||
"text": "Facts & Figures",
|
||||
"url": "/usage/facts-figures"
|
||||
},
|
||||
{
|
||||
"text": "spaCy 101",
|
||||
"url": "/usage/spacy-101"
|
||||
},
|
||||
{
|
||||
"text": "New in v3.7",
|
||||
"url": "/usage/v3-7"
|
||||
},
|
||||
{
|
||||
"text": "New in v3.6",
|
||||
"url": "/usage/v3-6"
|
||||
},
|
||||
{
|
||||
"text": "New in v3.5",
|
||||
"url": "/usage/v3-5"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Guides",
|
||||
"items": [
|
||||
{ "text": "Linguistic Features", "url": "/usage/linguistic-features" },
|
||||
{ "text": "Rule-based Matching", "url": "/usage/rule-based-matching" },
|
||||
{ "text": "Processing Pipelines", "url": "/usage/processing-pipelines" },
|
||||
{
|
||||
"text": "Linguistic Features",
|
||||
"url": "/usage/linguistic-features"
|
||||
},
|
||||
{
|
||||
"text": "Rule-based Matching",
|
||||
"url": "/usage/rule-based-matching"
|
||||
},
|
||||
{
|
||||
"text": "Processing Pipelines",
|
||||
"url": "/usage/processing-pipelines"
|
||||
},
|
||||
{
|
||||
"text": "Embeddings & Transformers",
|
||||
"url": "/usage/embeddings-transformers"
|
||||
},
|
||||
{
|
||||
"text": "Large Language Models",
|
||||
"url": "/usage/large-language-models",
|
||||
"tag": "new"
|
||||
"url": "/usage/large-language-models"
|
||||
},
|
||||
{
|
||||
"text": "Training Models",
|
||||
"url": "/usage/training"
|
||||
},
|
||||
{ "text": "Training Models", "url": "/usage/training" },
|
||||
{
|
||||
"text": "Layers & Model Architectures",
|
||||
"url": "/usage/layers-architectures"
|
||||
},
|
||||
{ "text": "spaCy Projects", "url": "/usage/projects" },
|
||||
{ "text": "Saving & Loading", "url": "/usage/saving-loading" },
|
||||
{ "text": "Visualizers", "url": "/usage/visualizers" }
|
||||
{
|
||||
"text": "spaCy Projects",
|
||||
"url": "/usage/projects"
|
||||
},
|
||||
{
|
||||
"text": "Saving & Loading",
|
||||
"url": "/usage/saving-loading"
|
||||
},
|
||||
{
|
||||
"text": "Memory Management",
|
||||
"url": "/usage/memory-management"
|
||||
},
|
||||
{
|
||||
"text": "Visualizers",
|
||||
"url": "/usage/visualizers"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Resources",
|
||||
"items": [
|
||||
{ "text": "Project Templates", "url": "https://github.com/explosion/projects" },
|
||||
{ "text": "v2.x Documentation", "url": "https://v2.spacy.io" },
|
||||
{
|
||||
"text": "Project Templates",
|
||||
"url": "https://github.com/explosion/projects"
|
||||
},
|
||||
{
|
||||
"text": "v2.x Documentation",
|
||||
"url": "https://v2.spacy.io"
|
||||
},
|
||||
{
|
||||
"text": "Custom Solutions",
|
||||
"url": "https://explosion.ai/custom-solutions"
|
||||
@@ -57,7 +108,12 @@
|
||||
"items": [
|
||||
{
|
||||
"label": "Models",
|
||||
"items": [{ "text": "Overview", "url": "/models" }]
|
||||
"items": [
|
||||
{
|
||||
"text": "Overview",
|
||||
"url": "/models"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Trained Pipelines",
|
||||
@@ -71,91 +127,261 @@
|
||||
{
|
||||
"label": "Overview",
|
||||
"items": [
|
||||
{ "text": "Library Architecture", "url": "/api" },
|
||||
{ "text": "Model Architectures", "url": "/api/architectures" },
|
||||
{ "text": "Data Formats", "url": "/api/data-formats" },
|
||||
{ "text": "Command Line", "url": "/api/cli" },
|
||||
{ "text": "Functions", "url": "/api/top-level" }
|
||||
{
|
||||
"text": "Library Architecture",
|
||||
"url": "/api"
|
||||
},
|
||||
{
|
||||
"text": "Model Architectures",
|
||||
"url": "/api/architectures"
|
||||
},
|
||||
{
|
||||
"text": "Data Formats",
|
||||
"url": "/api/data-formats"
|
||||
},
|
||||
{
|
||||
"text": "Command Line",
|
||||
"url": "/api/cli"
|
||||
},
|
||||
{
|
||||
"text": "Functions",
|
||||
"url": "/api/top-level"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Containers",
|
||||
"items": [
|
||||
{ "text": "Doc", "url": "/api/doc" },
|
||||
{ "text": "DocBin", "url": "/api/docbin" },
|
||||
{ "text": "Example", "url": "/api/example" },
|
||||
{ "text": "Language", "url": "/api/language" },
|
||||
{ "text": "Lexeme", "url": "/api/lexeme" },
|
||||
{ "text": "Span", "url": "/api/span" },
|
||||
{ "text": "SpanGroup", "url": "/api/spangroup" },
|
||||
{ "text": "Token", "url": "/api/token" }
|
||||
{
|
||||
"text": "Doc",
|
||||
"url": "/api/doc"
|
||||
},
|
||||
{
|
||||
"text": "DocBin",
|
||||
"url": "/api/docbin"
|
||||
},
|
||||
{
|
||||
"text": "Example",
|
||||
"url": "/api/example"
|
||||
},
|
||||
{
|
||||
"text": "Language",
|
||||
"url": "/api/language"
|
||||
},
|
||||
{
|
||||
"text": "Lexeme",
|
||||
"url": "/api/lexeme"
|
||||
},
|
||||
{
|
||||
"text": "Span",
|
||||
"url": "/api/span"
|
||||
},
|
||||
{
|
||||
"text": "SpanGroup",
|
||||
"url": "/api/spangroup"
|
||||
},
|
||||
{
|
||||
"text": "Token",
|
||||
"url": "/api/token"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Pipeline",
|
||||
"items": [
|
||||
{ "text": "AttributeRuler", "url": "/api/attributeruler" },
|
||||
{ "text": "CoreferenceResolver", "url": "/api/coref" },
|
||||
{ "text": "CuratedTransformer", "url": "/api/curatedtransformer" },
|
||||
{ "text": "DependencyParser", "url": "/api/dependencyparser" },
|
||||
{ "text": "EditTreeLemmatizer", "url": "/api/edittreelemmatizer" },
|
||||
{ "text": "EntityLinker", "url": "/api/entitylinker" },
|
||||
{ "text": "EntityRecognizer", "url": "/api/entityrecognizer" },
|
||||
{ "text": "EntityRuler", "url": "/api/entityruler" },
|
||||
{ "text": "Large Language Models", "url": "/api/large-language-models" },
|
||||
{ "text": "Lemmatizer", "url": "/api/lemmatizer" },
|
||||
{ "text": "Morphologizer", "url": "/api/morphologizer" },
|
||||
{ "text": "SentenceRecognizer", "url": "/api/sentencerecognizer" },
|
||||
{ "text": "Sentencizer", "url": "/api/sentencizer" },
|
||||
{ "text": "SpanCategorizer", "url": "/api/spancategorizer" },
|
||||
{ "text": "SpanFinder", "url": "/api/spanfinder" },
|
||||
{ "text": "SpanResolver", "url": "/api/span-resolver" },
|
||||
{ "text": "SpanRuler", "url": "/api/spanruler" },
|
||||
{ "text": "Tagger", "url": "/api/tagger" },
|
||||
{ "text": "TextCategorizer", "url": "/api/textcategorizer" },
|
||||
{ "text": "Tok2Vec", "url": "/api/tok2vec" },
|
||||
{ "text": "Tokenizer", "url": "/api/tokenizer" },
|
||||
{ "text": "TrainablePipe", "url": "/api/pipe" },
|
||||
{ "text": "Transformer", "url": "/api/transformer" },
|
||||
{ "text": "Other Functions", "url": "/api/pipeline-functions" }
|
||||
{
|
||||
"text": "AttributeRuler",
|
||||
"url": "/api/attributeruler"
|
||||
},
|
||||
{
|
||||
"text": "CoreferenceResolver",
|
||||
"url": "/api/coref"
|
||||
},
|
||||
{
|
||||
"text": "CuratedTransformer",
|
||||
"url": "/api/curatedtransformer"
|
||||
},
|
||||
{
|
||||
"text": "DependencyParser",
|
||||
"url": "/api/dependencyparser"
|
||||
},
|
||||
{
|
||||
"text": "EditTreeLemmatizer",
|
||||
"url": "/api/edittreelemmatizer"
|
||||
},
|
||||
{
|
||||
"text": "EntityLinker",
|
||||
"url": "/api/entitylinker"
|
||||
},
|
||||
{
|
||||
"text": "EntityRecognizer",
|
||||
"url": "/api/entityrecognizer"
|
||||
},
|
||||
{
|
||||
"text": "EntityRuler",
|
||||
"url": "/api/entityruler"
|
||||
},
|
||||
{
|
||||
"text": "Large Language Models",
|
||||
"url": "/api/large-language-models"
|
||||
},
|
||||
{
|
||||
"text": "Lemmatizer",
|
||||
"url": "/api/lemmatizer"
|
||||
},
|
||||
{
|
||||
"text": "Morphologizer",
|
||||
"url": "/api/morphologizer"
|
||||
},
|
||||
{
|
||||
"text": "SentenceRecognizer",
|
||||
"url": "/api/sentencerecognizer"
|
||||
},
|
||||
{
|
||||
"text": "Sentencizer",
|
||||
"url": "/api/sentencizer"
|
||||
},
|
||||
{
|
||||
"text": "SpanCategorizer",
|
||||
"url": "/api/spancategorizer"
|
||||
},
|
||||
{
|
||||
"text": "SpanFinder",
|
||||
"url": "/api/spanfinder"
|
||||
},
|
||||
{
|
||||
"text": "SpanResolver",
|
||||
"url": "/api/span-resolver"
|
||||
},
|
||||
{
|
||||
"text": "SpanRuler",
|
||||
"url": "/api/spanruler"
|
||||
},
|
||||
{
|
||||
"text": "Tagger",
|
||||
"url": "/api/tagger"
|
||||
},
|
||||
{
|
||||
"text": "TextCategorizer",
|
||||
"url": "/api/textcategorizer"
|
||||
},
|
||||
{
|
||||
"text": "Tok2Vec",
|
||||
"url": "/api/tok2vec"
|
||||
},
|
||||
{
|
||||
"text": "Tokenizer",
|
||||
"url": "/api/tokenizer"
|
||||
},
|
||||
{
|
||||
"text": "TrainablePipe",
|
||||
"url": "/api/pipe"
|
||||
},
|
||||
{
|
||||
"text": "Transformer",
|
||||
"url": "/api/transformer"
|
||||
},
|
||||
{
|
||||
"text": "Other Functions",
|
||||
"url": "/api/pipeline-functions"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Matchers",
|
||||
"items": [
|
||||
{ "text": "DependencyMatcher", "url": "/api/dependencymatcher" },
|
||||
{ "text": "Matcher", "url": "/api/matcher" },
|
||||
{ "text": "PhraseMatcher", "url": "/api/phrasematcher" }
|
||||
{
|
||||
"text": "DependencyMatcher",
|
||||
"url": "/api/dependencymatcher"
|
||||
},
|
||||
{
|
||||
"text": "Matcher",
|
||||
"url": "/api/matcher"
|
||||
},
|
||||
{
|
||||
"text": "PhraseMatcher",
|
||||
"url": "/api/phrasematcher"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Other",
|
||||
"items": [
|
||||
{ "text": "Attributes", "url": "/api/attributes" },
|
||||
{ "text": "BaseVectors", "url": "/api/basevectors" },
|
||||
{ "text": "Corpus", "url": "/api/corpus" },
|
||||
{ "text": "InMemoryLookupKB", "url": "/api/inmemorylookupkb" },
|
||||
{ "text": "KnowledgeBase", "url": "/api/kb" },
|
||||
{ "text": "Lookups", "url": "/api/lookups" },
|
||||
{ "text": "MorphAnalysis", "url": "/api/morphology#morphanalysis" },
|
||||
{ "text": "Morphology", "url": "/api/morphology" },
|
||||
{ "text": "Scorer", "url": "/api/scorer" },
|
||||
{ "text": "StringStore", "url": "/api/stringstore" },
|
||||
{ "text": "Vectors", "url": "/api/vectors" },
|
||||
{ "text": "Vocab", "url": "/api/vocab" }
|
||||
{
|
||||
"text": "Attributes",
|
||||
"url": "/api/attributes"
|
||||
},
|
||||
{
|
||||
"text": "BaseVectors",
|
||||
"url": "/api/basevectors"
|
||||
},
|
||||
{
|
||||
"text": "Corpus",
|
||||
"url": "/api/corpus"
|
||||
},
|
||||
{
|
||||
"text": "InMemoryLookupKB",
|
||||
"url": "/api/inmemorylookupkb"
|
||||
},
|
||||
{
|
||||
"text": "KnowledgeBase",
|
||||
"url": "/api/kb"
|
||||
},
|
||||
{
|
||||
"text": "Lookups",
|
||||
"url": "/api/lookups"
|
||||
},
|
||||
{
|
||||
"text": "MorphAnalysis",
|
||||
"url": "/api/morphology#morphanalysis"
|
||||
},
|
||||
{
|
||||
"text": "Morphology",
|
||||
"url": "/api/morphology"
|
||||
},
|
||||
{
|
||||
"text": "Scorer",
|
||||
"url": "/api/scorer"
|
||||
},
|
||||
{
|
||||
"text": "StringStore",
|
||||
"url": "/api/stringstore"
|
||||
},
|
||||
{
|
||||
"text": "Vectors",
|
||||
"url": "/api/vectors"
|
||||
},
|
||||
{
|
||||
"text": "Vocab",
|
||||
"url": "/api/vocab"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Cython",
|
||||
"items": [
|
||||
{ "text": "Architecture", "url": "/api/cython" },
|
||||
{ "text": "Classes", "url": "/api/cython-classes" },
|
||||
{ "text": "Structs", "url": "/api/cython-structs" }
|
||||
{
|
||||
"text": "Architecture",
|
||||
"url": "/api/cython"
|
||||
},
|
||||
{
|
||||
"text": "Classes",
|
||||
"url": "/api/cython-classes"
|
||||
},
|
||||
{
|
||||
"text": "Structs",
|
||||
"url": "/api/cython-structs"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Legacy",
|
||||
"items": [{ "text": "Legacy functions", "url": "/api/legacy" }]
|
||||
"items": [
|
||||
{
|
||||
"text": "Legacy functions",
|
||||
"url": "/api/legacy"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
},
|
||||
"docSearch": {
|
||||
"appId": "Y1LB128RON",
|
||||
"apiKey": "bb601a1daab73e2dc66faf2b79564807",
|
||||
"indexName": "spacy"
|
||||
},
|
||||
"binderUrl": "explosion/spacy-io-binder",
|
||||
@@ -76,8 +75,9 @@
|
||||
{
|
||||
"label": "Connect",
|
||||
"items": [
|
||||
{ "text": "Twitter", "url": "https://twitter.com/spacy_io" },
|
||||
{ "text": "Bluesky", "url": "https://bsky.app/profile/explosion-ai.bsky.social" },
|
||||
{ "text": "GitHub", "url": "https://github.com/explosion/spaCy" },
|
||||
{ "text": "Live Stream", "url": "https://www.youtube.com/playlist?list=PLBmcuObd5An5_iAxNYLJa_xWmNzsYce8c" },
|
||||
{ "text": "YouTube", "url": "https://youtube.com/c/ExplosionAI" },
|
||||
{ "text": "Blog", "url": "https://explosion.ai/blog" }
|
||||
]
|
||||
|
||||
+1444
-293
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,9 @@ const nextConfig = withPWA(
|
||||
ignoreBuildErrors: true,
|
||||
},
|
||||
images: { unoptimized: true },
|
||||
env: {
|
||||
DOCSEARCH_API_KEY: process.env.DOCSEARCH_API_KEY
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { DocSearch } from '@docsearch/react'
|
||||
import '@docsearch/css'
|
||||
@@ -6,7 +6,8 @@ import '@docsearch/css'
|
||||
import siteMetadata from '../../meta/site.json'
|
||||
|
||||
export default function Search({ placeholder = 'Search docs' }) {
|
||||
const { apiKey, indexName, appId } = siteMetadata.docSearch
|
||||
const apiKey = process.env.DOCSEARCH_API_KEY
|
||||
const { indexName, appId } = siteMetadata.docSearch
|
||||
return (
|
||||
<DocSearch appId={appId} indexName={indexName} apiKey={apiKey} placeholder={placeholder} />
|
||||
)
|
||||
|
||||
@@ -109,6 +109,8 @@
|
||||
box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.25)
|
||||
background: var(--color-dark)
|
||||
margin: 1.5rem 0 0 2rem
|
||||
position: sticky
|
||||
left: 2rem
|
||||
|
||||
.header
|
||||
width: 100%
|
||||
|
||||
@@ -87,6 +87,9 @@
|
||||
margin-bottom: 0
|
||||
height: 100%
|
||||
|
||||
a, a:hover
|
||||
color: inherit
|
||||
|
||||
.banner-content-small
|
||||
display: block
|
||||
margin-bottom: 0 !important
|
||||
|
||||
@@ -58,8 +58,8 @@ const AlertSpace = ({ nightly, legacy }) => {
|
||||
}
|
||||
|
||||
const navAlert = (
|
||||
<Link to="https://form.typeform.com/to/WlflqP1b" noLinkLayout>
|
||||
💥 Interested in <strong>Premium spaCy Models</strong>?
|
||||
<Link to="https://beta.ellf.ai" noLinkLayout>
|
||||
💥 Beta test our new tool for <strong>agentic NLP development</strong>!
|
||||
</Link>
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user