From dbd850b8156c5e5dc0234fe29f02747208de99a9 Mon Sep 17 00:00:00 2001 From: Lj Miranda <12949683+ljvmiranda921@users.noreply.github.com> Date: Mon, 31 Jan 2022 15:41:42 +0800 Subject: [PATCH] Clarify Span.ents documentation (#10154) * Clarify Span.ents documentation Ref: #10135 Retain current behaviour. Span.ents will only include entities within said span. You can't get tokens outside of the original span. * Reword docstrings Co-authored-by: Adriane Boyd * Update API docs in the website Co-authored-by: Adriane Boyd --- spacy/tokens/span.pyx | 4 ++-- website/docs/api/span.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spacy/tokens/span.pyx b/spacy/tokens/span.pyx index cd02cab36..0c36c754b 100644 --- a/spacy/tokens/span.pyx +++ b/spacy/tokens/span.pyx @@ -469,8 +469,8 @@ cdef class Span: @property def ents(self): - """The named entities in the span. Returns a tuple of named entity - `Span` objects, if the entity recognizer has been applied. + """The named entities that fall completely within the span. Returns + a tuple of `Span` objects. RETURNS (tuple): Entities in the span, one `Span` per entity. diff --git a/website/docs/api/span.md b/website/docs/api/span.md index 7ecebf93e..ff7905bc0 100644 --- a/website/docs/api/span.md +++ b/website/docs/api/span.md @@ -257,8 +257,8 @@ shape `(N, M)`, where `N` is the length of the document. The values will be ## Span.ents {#ents tag="property" new="2.0.13" model="ner"} -The named entities in the span. Returns a tuple of named entity `Span` objects, -if the entity recognizer has been applied. +The named entities that fall completely within the span. Returns a tuple of +`Span` objects. > #### Example >