class_docstr: Processor for the DuEE data set.
class_docstr_tok: ["Processor","for","the","DuEE","data","set","."]
code: def data_process(self, raw_data, trigger_pred_list):
      output = ["text_a\tlabel\ttrigger_tag\tindex"]
  
      assert len(raw_data) == len(trigger_pred_list)
      for idx, line in enumerate(
          tqdm(raw_data, desc="processing pred_trigger")
      ):
          line = json.loads(line)
          text_a = line["tokens"]
          trigger_pred = trigger_pred_list[idx]
  
          assert len(trigger_pred) == len(text_a)
  
          if len(line["event_mentions"]) == 0:
              output.append(
                  "{}\t{}\t{}\t{}".format(
                      " ".join(text_a),
                      " ".join(["O"] * len(text_a)),
                      " ".join(trigger_pred),
                      idx,
                  )
              )
              continue
  
          entity_mention = line["entity_mentions"]
          entity_id2mention = {
              mention["id"]: mention for mention in entity_mention
          }
  
          for mention in line["event_mentions"]:
              trigger_labels = ["O"] * len(text_a)
              event_type = mention["event_type"]
              trigger_start = mention["trigger"]["start"]
              trigger_end = mention["trigger"]["end"]
              trigger = mention["trigger"]["text"]
              trigger_labels = label_data(
                  trigger_labels,
                  trigger_start,
                  trigger_end - trigger_start,
                  event_type,
              )
  
              for i in range(trigger_start, trigger_end):
                  if i == len(trigger_pred):
                      break
                  trigger_labels[i] = trigger_pred[i]
                  trigger_pred[i] = "O"
  
              role_labels = ["O"] * len(text_a)
              for arg in mention["arguments"]:
                  role_type = arg["role"]
                  argument = arg["text"]
                  role_entity = entity_id2mention[arg["entity_id"]]
                  role_start = role_entity["start"]
                  role_end = role_entity["end"]
                  role_labels = label_data(
                      role_labels,
                      role_start,
                      role_end - role_start,
                      role_type,
                  )
  
              assert (
                  len(text_a) == len(role_labels) == len(trigger_labels)
              )
              output.append(
                  "{}\t{}\t{}\t{}".format(
                      " ".join(text_a),
                      " ".join(role_labels),
                      " ".join(trigger_labels),
                      idx,
                  )
              )
  
          trigger_remained_labels_list = process_remained_pred_trigger(
              trigger_pred
          )
          for remained_labels in trigger_remained_labels_list:
              assert len(text_a) == len(remained_labels)
              output.append(
                  "{}\t{}\t{}\t{}".format(
                      " ".join(text_a),
                      " ".join(["O"] * len(text_a)),
                      " ".join(remained_labels),
                      idx,
                  )
              )
  
      print(len(output))
      return output
  
imports: from __future__ import absolute_import, division, print_function
  import json
  import logging
  import os
  import sys
  from copy import deepcopy
  from io import open
  from transformers import XLMRobertaTokenizer, BertTokenizer, RobertaTokenizer, AutoTokenizer
  from .utils_ee import read_by_lines, write_by_lines, load_dict, label_data, process_remained_pred_trigger, clear_wrong_tokens
  from torch.nn.utils.rnn import pad_sequence
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling the ACEProcessor obj's underlying member method code with example usage: obj.data_process(raw_data, trigger_pred_list) and returns: output