      output = Doc(vocab, words=tok_annot["ORTH"], spaces=tok_annot["SPACY"])
      if "entities" in doc_annot:
         _add_entities_to_doc(output, doc_annot["entities"])
      if array.size:
          output = output.from_array(attrs, array)
      # links are currently added with ENT_KB_ID on the token level
      output.cats.update(doc_annot.get("cats", {}))
      return output
 
</s> remove             if key == "entities":
 </s> add             if key in ["entities", "cats", "spans"]: </s> remove             elif key in ("cats", "links"):
 </s> add             elif key in ("cats", "links", "spans"): </s> remove             elif key == "cats":
                pass
 </s> add  </s> remove             "you're setting don't overlap.")
 </s> add             "you're setting don't overlap. To work with overlapping entities, "
            "consider using doc.spans instead.")
    if "spans" in doc_annot:
       _add_spans_to_doc(output, doc_annot["spans"])
      output = Doc(vocab, words=tok_annot["ORTH"], spaces=tok_annot["SPACY"])
      if "entities" in doc_annot:
         _add_entities_to_doc(output, doc_annot["entities"])
    if "spans" in doc_annot:
       _add_spans_to_doc(output, doc_annot["spans"])
      if array.size:
          output = output.from_array(attrs, array)
      # links are currently added with ENT_KB_ID on the token level
      output.cats.update(doc_annot.get("cats", {}))
      return output
keep keep add keep keep keep keep keep
 Support doc.spans in Example.from_dict (#7197)

* add support for spans in Example.from_dict

* add unit tests

* update error to E879 
spacy/training/example.pyx