def get_doc(vocab, words=[], pos=None, heads=None, deps=None, tags=None, ents=None):
pos = pos or ["<STR_LIT>"] * len(words)<EOL>tags = tags or ["<STR_LIT>"] * len(words)<EOL>heads = heads or [<NUM_LIT:0>] * len(words)<EOL>deps = deps or ["<STR_LIT>"] * len(words)<EOL>for value in deps + tags + pos:<EOL><INDENT>vocab.strings.add(value)<EOL><DEDENT>doc = Doc(vocab, words=words)<EOL>attrs = doc.to_array([POS, HEAD, DEP])<EOL>for i, (p, head, dep) in enumerate(zip(pos, heads, deps)):<EOL><INDENT>attrs[i, <NUM_LIT:0>] = doc.vocab.strings[p]<EOL>attrs[i, <NUM_LIT:1>] = head<EOL>attrs[i, <NUM_LIT:2>] = doc.vocab.strings[dep]<EOL><DEDENT>doc.from_array([POS, HEAD, DEP], attrs)<EOL>if ents:<EOL><INDENT>doc.ents = [<EOL>Span(doc, start, end, label=doc.vocab.strings[label])<EOL>for start, end, label in ents<EOL>]<EOL><DEDENT>if tags:<EOL><INDENT>for token in doc:<EOL><INDENT>token.tag_ = tags[token.i]<EOL><DEDENT><DEDENT>return doc<EOL>
Create Doc object from given vocab, words and annotations.