code: def parse_sentences_test2(
      turn,
      time_beg,
      time_end,
      method,
      concepts_full,
      concepts_relax,
      task,
  ):
      """
      Get the sentences spoken by the speaker (not the "Compère" aka Woz).
  
      Arguments:
      -------
      turn: list of Document
          All the xml following nodes present in the turn.
      time_beg: str
          Time (s) at the beginning of the turn.
      time_end: str
          Time (s) at the end of the turn.
      method: str
          Either 'full' or 'relax'.
      concepts_full: list of str
          Concepts in method full.
      concepts_relax: list of str
          Concepts equivalent in method relax.
      task: str
          Either 'asr' or 'slu'.
  
      Returns
      -------
      dictionnary of str
      """
  
      sentences = [["", "", time_beg, time_end]]
      n = 0  # Number of segments in the turn
      concept = "null"
      has_speech = False
      concept_open = False
      sync_waiting = False
      time = None
  
      # For each node in the Turn
      for node in turn.childNodes:
          # Check concept
          if task == "slu" and node.nodeName == "SemDebut":
              concept = node.getAttribute("concept")
              if method == "relax":
                  concept = get_concept_relax(
                      concept, concepts_full, concepts_relax
                  )
  
          # Check transcription
          if (
              node.nodeType == node.TEXT_NODE
              and node.data.replace("\n", "") != ""
          ):
              (
                  sentences,
                  has_speech,
                  sync_waiting,
                  concept_open,
              ) = process_text_node(
                  node,
                  sentences,
                  sync_waiting,
                  has_speech,
                  concept,
                  concept_open,
                  task,
                  n,
                  time_end,
              )
  
          # Save audio segment
          if task == "slu" and node.nodeName == "SemFin":
              (
                  sentences,
                  concept,
                  concept_open,
                  has_speech,
                  sync_waiting,
                  n,
              ) = process_semfin_node(
                  sentences,
                  sync_waiting,
                  has_speech,
                  concept,
                  concept_open,
                  n,
                  time,
                  time_end,
              )
  
          if node.nodeName == "Sync":
              (
                  sentences,
                  has_speech,
                  sync_waiting,
                  time,
                  n,
              ) = process_sync_node(
                  node,
                  sentences,
                  sync_waiting,
                  has_speech,
                  concept_open,
                  task,
                  n,
                  time,
                  time_end,
              )
  
      sentences = clean_last_char(sentences)
  
      return sentences
  
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 7 for calling a global function with example usage: parse_sentences_test2(turn, time_beg, time_end, method, concepts_full, concepts_relax, task) and returns: sentences