docstr: Convert data dict which contains essential information to SMSample.
  
  :param dict data: contains 'sentence1', 'sentence2', 'y' keys.
  :return:
docstr_tok: ["Convert","data","dict","which","contains","essential","information","to","SMSample",".",":","param","dict","data",":","contains","'sentence1","'",",","'sentence2","'",",","'","y","'","keys",".",":","return",":"]
code: def load(self, data):
      """
      Convert data dict which contains essential information to SMSample.
  
      :param dict data: contains 'sentence1', 'sentence2', 'y' keys.
      :return:
  
      """
      self.sentence1 = TextField(data["sentence1"])
      self.sentence2 = TextField(data["sentence2"])
      self.y = Field(data["y"], field_type=str)
  
      if not self.is_legal():
          raise ValueError("y can only be '0' or '1'")
  
file_path: textflint/textflint/input/component/sample/sm_sample.py
imports: from .sample import Sample
  from ..field import Field
  from ..field import TextField
label_desc: Use image node_id 4 for calling the SMSample obj's underlying member method code with example usage: obj.load(data) without return types