Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extra/DEVELOPER_DOCS/Listeners.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ model = chain(
)
```

but the standalone `Tok2VecTransformer` has an additional `split_trf_batch` chained inbetween the model
but the standalone `Tok2VecTransformer` has an additional `split_trf_batch` chained in between the model
and `trfs2arrays`:

```
Expand Down
4 changes: 2 additions & 2 deletions extra/DEVELOPER_DOCS/Satellite Packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is a list of all the active repos relevant to spaCy besides the main one, w

These packages are always pulled in when you install spaCy. Most of them are direct dependencies, but some are transitive dependencies through other packages.

- [spacy-legacy](https://github.com/explosion/spacy-legacy): When an architecture in spaCy changes enough to get a new version, the old version is frozen and moved to spacy-legacy. This allows us to keep the core library slim while also preserving backwards compatability.
- [spacy-legacy](https://github.com/explosion/spacy-legacy): When an architecture in spaCy changes enough to get a new version, the old version is frozen and moved to spacy-legacy. This allows us to keep the core library slim while also preserving backwards compatibility.
- [thinc](https://github.com/explosion/thinc): Thinc is the machine learning library that powers trainable components in spaCy. It wraps backends like Numpy, PyTorch, and Tensorflow to provide a functional interface for specifying architectures.
- [catalogue](https://github.com/explosion/catalogue): Small library for adding function registries, like those used for model architectures in spaCy.
- [confection](https://github.com/explosion/confection): This library contains the functionality for config parsing that was formerly contained directly in Thinc.
Expand Down Expand Up @@ -67,7 +67,7 @@ These repos are used to support the spaCy docs or otherwise present information

These repos are used for organizing data around spaCy, but are not something an end user would need to install as part of using the library.

- [spacy-models](https://github.com/explosion/spacy-models): This repo contains metadata (but not training data) for all the spaCy models. This includes information about where their training data came from, version compatability, and performance information. It also includes tests for the model packages, and the built models are hosted as releases of this repo.
- [spacy-models](https://github.com/explosion/spacy-models): This repo contains metadata (but not training data) for all the spaCy models. This includes information about where their training data came from, version compatibility, and performance information. It also includes tests for the model packages, and the built models are hosted as releases of this repo.
- [wheelwright](https://github.com/explosion/wheelwright): A tool for automating our PyPI builds and releases.
- [ec2buildwheel](https://github.com/explosion/ec2buildwheel): A small project that allows you to build Python packages in the manner of cibuildwheel, but on any EC2 image. Used by wheelwright.

Expand Down
2 changes: 1 addition & 1 deletion extra/DEVELOPER_DOCS/StringStore-Vocab.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ These are things stored in the vocab:
- `get_noun_chunks`: a syntax iterator
- lex attribute getters: functions like `is_punct`, set in language defaults
- `cfg`: **not** the pipeline config, this is mostly unused
- `_unused_object`: Formerly an unused object, kept around until v4 for compatability
- `_unused_object`: Formerly an unused object, kept around until v4 for compatibility

Some of these, like the Morphology and Vectors, are complex enough that they
need their own explanations. Here we'll just look at Vocab-specific items.
Expand Down
2 changes: 1 addition & 1 deletion spacy/cli/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def info(


def info_spacy() -> Dict[str, Any]:
"""Generate info about the current spaCy intallation.
"""Generate info about the current spaCy installation.

RETURNS (dict): The spaCy info.
"""
Expand Down
2 changes: 1 addition & 1 deletion spacy/glossary.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def explain(term):
# https://github.com/ltgoslo/norne
"EVT": "Festivals, cultural events, sports events, weather phenomena, wars, etc.",
"PROD": "Product, i.e. artificially produced entities including speeches, radio shows, programming languages, contracts, laws and ideas",
"DRV": "Words (and phrases?) that are dervied from a name, but not a name in themselves, e.g. 'Oslo-mannen' ('the man from Oslo')",
"DRV": "Words (and phrases?) that are derived from a name, but not a name in themselves, e.g. 'Oslo-mannen' ('the man from Oslo')",
"GPE_LOC": "Geo-political entity, with a locative sense, e.g. 'John lives in Spain'",
"GPE_ORG": "Geo-political entity, with an organisation sense, e.g. 'Spain declined to meet with Belgium'",
}
2 changes: 1 addition & 1 deletion spacy/kb/kb_in_memory.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ cdef class InMemoryLookupKB(KnowledgeBase):

def add_alias(self, str alias, entities, probabilities):
"""
For a given alias, add its potential entities and prior probabilies to the KB.
For a given alias, add its potential entities and prior probabilities to the KB.
Return the alias_hash at the end
"""
if alias is None or len(alias) == 0:
Expand Down
4 changes: 2 additions & 2 deletions spacy/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class BaseDefaults:

def create_tokenizer() -> Callable[["Language"], Tokenizer]:
"""Registered function to create a tokenizer. Returns a factory that takes
the nlp object and returns a Tokenizer instance using the language detaults.
the nlp object and returns a Tokenizer instance using the language defaults.
"""

def tokenizer_factory(nlp: "Language") -> Tokenizer:
Expand Down Expand Up @@ -2450,7 +2450,7 @@ def send(self) -> None:
q.put(item)

def step(self) -> None:
"""Tell sender that comsumed one item. Data is sent to the workers after
"""Tell sender that consumed one item. Data is sent to the workers after
every chunk_size calls.
"""
self.count += 1
Expand Down
2 changes: 1 addition & 1 deletion spacy/matcher/dependencymatcher.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ cdef class DependencyMatcher:
self._root = defaultdict(list)

# Associates each key to a list of dicts where each dict describes all
# branches from a token (identifed by its position) to other tokens as
# branches from a token (identified by its position) to other tokens as
# a list of tuples: ('REL_OP', 'LEFT_ID')
# e.g. {'key': [{2: [('<', 'left_id'), ...] ...}, ... ], ...}
self._tree = defaultdict(list)
Expand Down
2 changes: 1 addition & 1 deletion spacy/pipeline/_edit_tree_internals/edit_trees.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cdef extern from "<algorithm>" namespace "std" nogil:
# An edit tree (Müller et al., 2015) is a tree structure that consists of
# edit operations. The two types of operations are string matches
# and string substitutions. Given an input string s and an output string t,
# subsitution and match nodes should be interpreted as follows:
# substitution and match nodes should be interpreted as follows:
#
# * Substitution node: consists of an original string and substitute string.
# If s matches the original string, then t is the substitute. Otherwise,
Expand Down
2 changes: 1 addition & 1 deletion spacy/pipeline/legacy/entity_linker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is present to provide a prior version of the EntityLinker component
# for backwards compatability. For details see #9669.
# for backwards compatibility. For details see #9669.

import random
import warnings
Expand Down
2 changes: 1 addition & 1 deletion spacy/pipeline/lemmatizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def rule_lemmatize(self, token: Token) -> List[str]:
if univ_pos == "":
warnings.warn(Warnings.W108)
return [string.lower()]
# See Issue #435 for example of where this logic is requied.
# See Issue #435 for example of where this logic is required.
if self.is_base_form(token):
return [string.lower()]
index_table = self.lookups.get_table("lemma_index", {})
Expand Down
2 changes: 1 addition & 1 deletion spacy/pipeline/trainable_pipe.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ cdef class TrainablePipe(Pipe):
def _validate_serialization_attrs(self):
"""Check that the pipe implements the required attributes. If a subclass
implements a custom __init__ method but doesn't set these attributes,
they currently default to None, so we need to perform additonal checks.
they currently default to None, so we need to perform additional checks.
"""
if not hasattr(self, "vocab") or self.vocab is None:
raise ValueError(Errors.E899.format(name=util.get_object_name(self)))
Expand Down
2 changes: 1 addition & 1 deletion spacy/strings.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_string_id(key):
# Coerce the integral key to the expected primitive hash type.
# This ensures that custom/overloaded "primitive" data types
# such as those implemented by numpy are not inadvertently used
# downsteam (as these are internally implemented as custom PyObjects
# downstream (as these are internally implemented as custom PyObjects
# whose comparison operators can incur a significant overhead).
return str_hash
else:
Expand Down
2 changes: 1 addition & 1 deletion spacy/training/alignment_array.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ from libc.stdint cimport int32_t


cdef class AlignmentArray:
"""AlignmentArray is similar to Thinc's Ragged with two simplfications:
"""AlignmentArray is similar to Thinc's Ragged with two simplifications:
indexing returns numpy arrays and this type can only be used for CPU arrays.
However, these changes make AlignmentArray more efficient for indexing in a
tight loop."""
Expand Down
2 changes: 1 addition & 1 deletion website/docs/api/curatedtransformer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ attribute.

| Name | Description |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `all_outputs` | List of `Ragged` tensors that correspends to outputs of the different transformer layers. Each tensor element corresponds to a piece identifier's representation. ~~List[Ragged]~~ |
| `all_outputs` | List of `Ragged` tensors that corresponds to outputs of the different transformer layers. Each tensor element corresponds to a piece identifier's representation. ~~List[Ragged]~~ |
| `last_layer_only` | If only the last transformer layer's outputs are preserved. ~~bool~~ |

### DocTransformerOutput.embedding_layer {id="doctransformeroutput-embeddinglayer",tag="property"}
Expand Down
6 changes: 3 additions & 3 deletions website/docs/api/large-language-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ candidate.
protocol required by [`spacy.EntityLinker.v1`](#el-v1). The built-in candidate
selector method allows loading existing knowledge bases in several ways, e. g.
loading from a spaCy pipeline with a (not necessarily trained) entity linking
component, and loading from a file describing the knowlege base as a .yaml file.
component, and loading from a file describing the knowledge base as a .yaml file.
Either way the loaded data will be converted to a spaCy `InMemoryLookupKB`
instance. The KB's selection capabilities are used to select the most likely
entity candidates for the specified mentions.
Expand Down Expand Up @@ -1103,7 +1103,7 @@ prompting.

| Argument | Description |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `examples` | Optional function that generates examples for few-shot learning. Deafults to `None`. ~~Optional[Callable[[], Iterable[Any]]]~~ |
| `examples` | Optional function that generates examples for few-shot learning. Defaults to `None`. ~~Optional[Callable[[], Iterable[Any]]]~~ |
| `parse_responses` (NEW) | Callable for parsing LLM responses for this task. Defaults to the internal parsing method for this task. ~~Optional[TaskResponseParser[SpanCatTask]]~~ |
| `prompt_example_type` (NEW) | Type to use for fewshot examples. Defaults to `TextCatExample`. ~~Optional[Type[FewshotExample]]~~ |
| `scorer` (NEW) | Scorer function that evaluates the task performance on provided examples. Defaults to the metric used by spaCy. ~~Optional[Scorer]~~ |
Expand Down Expand Up @@ -1624,7 +1624,7 @@ the same documents at each run that keeps batches of documents stored on disk.
| Argument | Description |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `path` | Cache directory. If `None`, no caching is performed, and this component will act as a NoOp. Defaults to `None`. ~~Optional[Union[str, Path]]~~ |
| `batch_size` | Number of docs in one batch (file). Once a batch is full, it will be peristed to disk. Defaults to 64. ~~int~~ |
| `batch_size` | Number of docs in one batch (file). Once a batch is full, it will be persisted to disk. Defaults to 64. ~~int~~ |
| `max_batches_in_mem` | Max. number of batches to hold in memory. Allows you to limit the effect on your memory if you're handling a lot of docs. Defaults to 4. ~~int~~ |

When retrieving a document, the `BatchCache` will first figure out what batch
Expand Down
2 changes: 1 addition & 1 deletion website/docs/usage/rule-based-matching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def collect_sents(matcher, doc, i, matches):
span = doc[start:end] # Matched span
sent = span.sent # Sentence containing matched span
# Append mock entity for match in displaCy style to matched_sents
# get the match span by ofsetting the start and end of the span with the
# get the match span by offsetting the start and end of the span with the
# start and end of the sentence in the doc
match_ents = [{
"start": span.start_char - sent.start_char,
Expand Down