if doc_id in tm_var:
denotations = tm_var[doc_id]["denotations"]
text = tm_var[doc_id]["text"]
denotations = [text[d["span"]["begin"]:d["span"]["end"]] for d in denotations]
for part_id, part in doc.parts.items():
for ann in chain(part.annotations, part.predicted_annotations):
After Change
dataset = Dataset()
for doc_id in tm_var:
doc = Document()
text = tm_var[doc_id]["text"]
part = Part(text)
denotations = tm_var[doc_id]["denotations"]
annotations = []