From 6017fcf69311c78f8ebc0bd1c6e3a2d2873d42dc Mon Sep 17 00:00:00 2001 From: Shantam Raj Date: Wed, 21 Apr 2021 12:46:32 +0530 Subject: [PATCH] Default code for Setting Entity annotations on the website errors (#7738) * the default example for "Setting entity annotations" errors on Binder * updating contributer info * using a new variable to store original entities --- .github/contributors/armsp.md | 6 +++--- website/docs/usage/linguistic-features.md | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/contributors/armsp.md b/.github/contributors/armsp.md index 63d1367e4..45607d69c 100644 --- a/.github/contributors/armsp.md +++ b/.github/contributors/armsp.md @@ -98,9 +98,9 @@ mark both statements: | Field | Entry | |------------------------------- | -------------------- | -| Name | Shantam | +| Name | Shantam Raj | | Company name (if applicable) | | | Title or role (if applicable) | | -| Date | 21/5/2018 | +| Date | 10/4/2021 | | GitHub username | armsp | -| Website (optional) | | +| Website (optional) |https://shantamraj.com| diff --git a/website/docs/usage/linguistic-features.md b/website/docs/usage/linguistic-features.md index 077b1a556..5a1293c2e 100644 --- a/website/docs/usage/linguistic-features.md +++ b/website/docs/usage/linguistic-features.md @@ -601,12 +601,13 @@ print('Before', ents) # Create a span for the new entity fb_ent = Span(doc, 0, 1, label="ORG") +orig_ents = list(doc.ents) # Option 1: Modify the provided entity spans, leaving the rest unmodified doc.set_ents([fb_ent], default="unmodified") # Option 2: Assign a complete list of ents to doc.ents -doc.ents = list(doc.ents) + [fb_ent] +doc.ents = orig_ents + [fb_ent] ents = [(e.text, e.start, e.end, e.label_) for e in doc.ents] print('After', ents)