def read_data(<EOL>nlp,<EOL>conllu_file,<EOL>text_file,<EOL>raw_text=True,<EOL>oracle_segments=False,<EOL>max_doc_length=None,<EOL>limit=None,<EOL>):
if not raw_text and not oracle_segments:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>paragraphs = split_text(text_file.read())<EOL>conllu = read_conllu(conllu_file)<EOL>docs = []<EOL>golds = []<EOL>for doc_id, (text, cd) in enumerate(zip(paragraphs, conllu)):<EOL><INDENT>sent_annots = []<EOL>for cs in cd:<EOL><INDENT>sent = defaultdict(list)<EOL>for id_, word, lemma, pos, tag, morph, head, dep, _, space_after in cs:<EOL><INDENT>if "<STR_LIT:.>" in id_:<EOL><INDENT>continue<EOL><DEDENT>if "<STR_LIT:->" in id_:<EOL><INDENT>continue<EOL><DEDENT>id_ = int(id_) - <NUM_LIT:1><EOL>head = int(head) - <NUM_LIT:1> if head != "<STR_LIT:0>" else id_<EOL>sent["<STR_LIT>"].append(word)<EOL>sent["<STR_LIT>"].append(tag)<EOL>sent["<STR_LIT>"].append(head)<EOL>sent["<STR_LIT>"].append("<STR_LIT>" if dep == "<STR_LIT:root>" else dep)<EOL>sent["<STR_LIT>"].append(space_after == "<STR_LIT:_>")<EOL><DEDENT>sent["<STR_LIT>"] = ["<STR_LIT:->"] * len(sent["<STR_LIT>"])<EOL>sent["<STR_LIT>"], sent["<STR_LIT>"] = projectivize(sent["<STR_LIT>"], sent["<STR_LIT>"])<EOL>if oracle_segments:<EOL><INDENT>docs.append(Doc(nlp.vocab, words=sent["<STR_LIT>"], spaces=sent["<STR_LIT>"]))<EOL>golds.append(GoldParse(docs[-<NUM_LIT:1>], **sent))<EOL><DEDENT>sent_annots.append(sent)<EOL>if raw_text and max_doc_length and len(sent_annots) >= max_doc_length:<EOL><INDENT>doc, gold = _make_gold(nlp, None, sent_annots)<EOL>sent_annots = []<EOL>docs.append(doc)<EOL>golds.append(gold)<EOL>if limit and len(docs) >= limit:<EOL><INDENT>return docs, golds<EOL><DEDENT><DEDENT><DEDENT>if raw_text and sent_annots:<EOL><INDENT>doc, gold = _make_gold(nlp, None, sent_annots)<EOL>docs.append(doc)<EOL>golds.append(gold)<EOL><DEDENT>if limit and len(docs) >= limit:<EOL><INDENT>return docs, golds<EOL><DEDENT><DEDENT>return docs, golds<EOL>
Read the CONLLU format into (Doc, GoldParse) tuples. If raw_text=True,
    include Doc objects created using nlp.make_doc and then aligned against
    the gold-standard sequences. If oracle_segments=True, include Doc objects
    created from the gold-standard segments. At least one must be True.