class_docstr: WSDSample Class
class_docstr_tok: ["WSDSample","Class"]
docstr: Check the format of input data(json format).
  
   :param dict data: data name
   
docstr_tok: ["Check","the","format","of","input","data","(","json","format",")",".",":","param","dict","data",":","data","name"]
code: def check_data(self, data):
      r"""
      Check the format of input data(json format).
  
       :param dict data: data name
      """
      # check sentence field
      assert (
          "sentence" in data
          and isinstance(data["sentence"], list)
          and len(data["sentence"]) > 0
      ), "Sentence should be in data, and type of sentence should be list."
      for word in data["sentence"]:
          assert isinstance(
              word, str
          ), "Type of item in term_list should be str."
      # check pos field
      assert "pos" in data and isinstance(
          data["pos"], list
      ), "Pos should be in data"
      assert len(data["pos"]) == len(
          data["sentence"]
      ), "Type of pos should be list of sentence length."
      for pos in data["pos"]:
          assert isinstance(
              pos, str
          ), "Type of item in pos should be str."
      # check lemma field
      assert (
          "lemma" in data
          and isinstance(data["lemma"], list)
          and len(data["lemma"]) == len(data["sentence"])
      ), "Lemma should be in data, and type of lemma should be list of sentence length."
      for lemma in data["lemma"]:
          assert isinstance(
              lemma, str
          ), "Type of item in lemma should be str."
      # check instance field
      assert (
          "instance" in data
          and isinstance(data["instance"], list)
          and len(data["instance"]) > 0
      ), "Instance should be in data, and type of instance should be list."
      # check every single instance
      for key, start, end, target, gk in data["instance"]:
          assert (
              isinstance(key, str)
              and isinstance(start, int)
              and isinstance(end, int)
              and isinstance(target, str)
              and isinstance(gk, str)
          ), "Type of item in instance should be [str,int,int,str,str]"
          assert (
              start < end
          ), "End position should be after start position."
          assert (
              " ".join(data["sentence"][start:end]).lower()
              == target.lower()
          ), "Target word is not at the correct position."
      # check sentence_id field
      assert (
          "sentence_id" in data
          and isinstance(data["sentence_id"], str)
          and len(data["sentence_id"]) > 0
      ), "Sentence_id should be in data, and type of sentence_id should be a valid str."
      # check source field
      assert (
          "source" in data
          and isinstance(data["source"], str)
          and data["source"] in self.WSD_CORPUS
      ), "Source should be in data, and type of source should be a valid str."
  
imports: from .sample import Sample
  from ..field import TextField, ListField
  import json
  from ....common.settings import TASK_MASK, PUNC
  import nltk
label_desc: Use image node_id 3 for calling the WSDSample obj's underlying member method code with example usage: obj.check_data(data) without return types