Skip to content

Commit

Permalink
Fix biluo_tags_from_offsets example and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ines committed Nov 26, 2017
1 parent 434030e commit e4ee666
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions website/api/goldparse.jade
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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']

Expand All @@ -163,5 +163,3 @@ p
+cell
| Unicode strings, describing the
| #[+a("/api/annotation#biluo") BILUO] tags.


0 comments on commit e4ee666

Please sign in to comment.