Remove redundant strings.add for Doc.char_span (#12429)

This commit is contained in:
Adriane Boyd 2023-04-03 11:38:56 +02:00 committed by GitHub
parent 476a2e7a0a
commit 4538ceb507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -544,10 +544,6 @@ cdef class Doc:
DOCS: https://spacy.io/api/doc#char_span
"""
if not isinstance(label, int):
label = self.vocab.strings.add(label)
if not isinstance(kb_id, int):
kb_id = self.vocab.strings.add(kb_id)
alignment_modes = ("strict", "contract", "expand")
if alignment_mode not in alignment_modes:
raise ValueError(