Skip to content

Commit

Permalink
Auto-format code with black (#11649)
Browse files Browse the repository at this point in the history
Co-authored-by: explosion-bot <[email protected]>
  • Loading branch information
github-actions[bot] and explosion-bot authored Oct 14, 2022
1 parent 6b5a3e7 commit ceb6235
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions spacy/pipeline/edit_tree_lemmatizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ def predict(self, docs: Iterable[Doc]) -> List[Ints2d]:
if not any(len(doc) for doc in docs):
# Handle cases where there are no tokens in any docs.
n_labels = len(self.cfg["labels"])
guesses: List[Ints2d] = [
self.model.ops.alloc2i(0, n_labels) for _ in docs
]
guesses: List[Ints2d] = [self.model.ops.alloc2i(0, n_labels) for _ in docs]
assert len(guesses) == n_docs
return guesses
scores = self.model.predict(docs)
Expand Down
6 changes: 3 additions & 3 deletions spacy/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,9 @@ class DocJSONSchema(BaseModel):
None, title="Indices of sentences' start and end indices"
)
text: StrictStr = Field(..., title="Document text")
spans: Optional[Dict[StrictStr, List[Dict[StrictStr, Union[StrictStr, StrictInt]]]]] = Field(
None, title="Span information - end/start indices, label, KB ID"
)
spans: Optional[
Dict[StrictStr, List[Dict[StrictStr, Union[StrictStr, StrictInt]]]]
] = Field(None, title="Span information - end/start indices, label, KB ID")
tokens: List[Dict[StrictStr, Union[StrictStr, StrictInt]]] = Field(
..., title="Token information - ID, start, annotations"
)
Expand Down

0 comments on commit ceb6235

Please sign in to comment.