From e4ee666be57be0a44656a52d44bcc74b144df8c9 Mon Sep 17 00:00:00 2001 From: ines Date: Sun, 26 Nov 2017 16:37:32 +0100 Subject: [PATCH] Fix biluo_tags_from_offsets example and docs --- website/api/goldparse.jade | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/website/api/goldparse.jade b/website/api/goldparse.jade index c27badee9..9fb47ccc4 100644 --- a/website/api/goldparse.jade +++ b/website/api/goldparse.jade @@ -123,7 +123,7 @@ p p | Returns a list of unicode strings, describing the tags. Each tag string - | will be of the form either #[code ""], #[code "O"] or + | will be of the form of either #[code ""], #[code "O"] or | #[code "{action}-{label}"], where action is one of #[code "B"], | #[code "I"], #[code "L"], #[code "U"]. The string #[code "-"] | is used where the entity offsets don't align with the tokenization in the @@ -135,9 +135,9 @@ p +aside-code("Example"). from spacy.gold import biluo_tags_from_offsets - text = 'I like London.' - entities = [(len('I like '), len('I like London'), 'LOC')] - doc = tokenizer(text) + + doc = nlp('I like London.') + entities = [(7, 13, 'LOC')] tags = biluo_tags_from_offsets(doc, entities) assert tags == ['O', 'O', 'U-LOC', 'O'] @@ -163,5 +163,3 @@ p +cell | Unicode strings, describing the | #[+a("/api/annotation#biluo") BILUO] tags. - -