From 47bbc46392c399767a6860a8dbfb2d0dfc0187ff Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Thu, 22 Apr 2021 08:50:09 +0200 Subject: [PATCH] update EL training data format in docs (#7839) * update EL training data format * fix typo * all -1 because reasons --- website/docs/api/data-formats.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/docs/api/data-formats.md b/website/docs/api/data-formats.md index ac6f4183d..de893611a 100644 --- a/website/docs/api/data-formats.md +++ b/website/docs/api/data-formats.md @@ -451,9 +451,11 @@ doc = nlp("I'm pretty happy about that!") gold_dict = {"cats": {"POSITIVE": 1.0, "NEGATIVE": 0.0}} example = Example.from_dict(doc, gold_dict) -# Training data for an Entity Linking component +# Training data for an Entity Linking component (also requires entities & sentences) doc = nlp("Russ Cochran his reprints include EC Comics.") -gold_dict = {"links": {(0, 12): {"Q7381115": 1.0, "Q2146908": 0.0}}} +gold_dict = {"entities": [(0, 12, "PERSON")], + "links": {(0, 12): {"Q7381115": 1.0, "Q2146908": 0.0}}, + "sent_starts": [1, -1, -1, -1, -1, -1, -1, -1]} example = Example.from_dict(doc, gold_dict) ```