class_docstr: Coref Sample
class_docstr_tok: ["Coref","Sample"]
docstr: Convert a conll-dict to CorefSample.
  
  :param None|dict data: None, or a conll-style dict
      Must have key: sentences, clusters
      May have key: doc_key, speakers, constituents, ner
  :return:
docstr_tok: ["Convert","a","conll-dict","to","CorefSample",".",":","param","None|dict","data",":","None",",","or","a","conll-style","dict","Must","have","key",":","sentences",",","clusters","May","have","key",":","doc_key",",","speakers",",","constituents",",","ner",":","return",":"]
code: def load(self, data):
      r"""
      Convert a conll-dict to CorefSample.
  
      :param None|dict data: None, or a conll-style dict
          Must have key: sentences, clusters
          May have key: doc_key, speakers, constituents, ner
      :return:
  
      """
      if data == None:
          # raise ValueError("In coref_sample: load_data, data == None")
          self.doc_key = ""
          self.x = TextField([])
          self.sen_map = []
          self.doc_sp = TextField([])
          self.clusters = ListField([])
          self.constituents = ListField([])
          self.ner = ListField([])
          return
      self.check_data(data)
      # doc_key
      self.doc_key = data["doc_key"] if "doc_key" in data else ""
      # sample mask, x, doc_sp
      x, sen_map = self.sens2doc(data["sentences"])
      mask = [ORIGIN] * len(x)
  
      for cluster in data["clusters"]:
          for [b, e] in cluster:
              for i in range(b, e + 1):
                  mask[i] = TASK_MASK
      self.x = TextField(x, mask=mask)
      self.sen_map = sen_map
  
      if "speakers" in data:
          doc_sp, sen_map = self.sens2doc(data["speakers"])
      else:
          doc_sp = ["sp"] * len(x)
      self.doc_sp = TextField(doc_sp, mask=mask)
      # clusters
      self.clusters = ListField(data["clusters"])
      # constituents, ner
      constituents = (
          data["constituents"] if "constituents" in data else []
      )
      ner = data["ner"] if "ner" in data else []
      self.constituents = ListField(constituents)
      self.ner = ListField(ner)
  
imports: from ....common.settings import ORIGIN, TASK_MASK
  from ....common.utils.fp_utils import *
  from ....common.utils.shift_utils import *
  from .sample import Sample
  from ..field import ListField, TextField
label_desc: Use image node_id 5 for calling the CorefSample obj's underlying member method code with example usage: obj.load(data) without return types