From 345e7f6bc4f768d41f5c2aaa6b2b3d4d2dc67c21 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 f7ddc5136..970c09d60 100644 --- a/spacy/tokens/span.pyx +++ b/spacy/tokens/span.pyx @@ -471,8 +471,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 >