code: def parse_test2(
      root,
      channels,
      filenames,
      save_folder,
      method,
      task,
      filename,
      concepts_full,
      concepts_relax,
  ):
      """
      This function prepares the data for the test2 csv files of the Media dataset.
      "Laperrière et al. The Spoken Language Understanding MEDIA Benchmark Dataset in the Era of Deep Learning: data updates, training and evaluation tools, LREC 2022" (https://aclanthology.org/2022.lrec-1.171) made the decision to make a new corpus named "test2".
      These xml files are structured differently from the original ones, explaining special functions for the test2.
      They are xml files made after the first dataset release, and have never been used before this recipe.
      This new corpus can be used as a second inference corpus, as the original test.
      Files are stored in /E0024/MEDIA1FR_00/MEDIA1FR/DATA/semantizer_files/.
  
      Arguments
      ---------
      root: Document
          Object representing the content of the Media xml document being processed.
      channels: list of str
          Channels (Right / Left) of the stereo recording to keep.
      filenames: list of str
          Linked IDs of the recordings, for the channels to keep.
      save_folder: str
          Path where the csvs and preprocessed wavs will be stored.
      method: str
          Either 'full' or 'relax'.
      task: str
          Either 'asr' or 'slu'.
      filename: str
          Name of the Media recording.
      concepts_full: list of str
          Concepts in method full.
      concepts_relax: list of str
          Concepts equivalent in method relax.
      """
  
      speaker_id, speaker_name = get_speaker_test2(root)
      channel = get_channel(filename, channels, filenames)
  
      data = []
  
      for turn in root.getElementsByTagName("Turn"):
          if turn.getAttribute("speaker") == speaker_id:
              time_beg = turn.getAttribute("startTime")
              time_end = turn.getAttribute("endTime")
  
              sentences = parse_sentences_test2(
                  turn,
                  time_beg,
                  time_end,
                  method,
                  concepts_full,
                  concepts_relax,
                  task,
              )
  
              if (
                  filename == "70"
                  and sentences[len(sentences) - 1][3] == "344.408"
              ):
                  sentences[len(sentences) - 1][3] = "321.000"
  
              data.append([channel, filename, speaker_name, sentences])
  
      return data
  
imports: import xml.dom.minidom
  from tqdm import tqdm
  import logging
  import subprocess
  import csv
  import os
  import glob
  import re
label_desc: Use image node_id 4 for calling a global function with example usage: parse_test2(root, channels, filenames, save_folder, method, task, filename, concepts_full, concepts_relax) and returns: data