code: def parse_sentences(turn, time_beg, time_end, method, task):
      """
      Get the sentences spoken by the speaker (not the "Compère" aka Woz).
  
      Arguments:
      -------
      turn: list of Document
          The current turn node.
      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'.
      task: str
          Either 'asr' or 'slu'.
  
      Returns
      -------
      dictionnary of str
      """
  
      has_speech = False
      sentences = [["", "", time_beg, time_end]]
      concept_open = False
      sync_waiting = False
      time = None
      n = 0  # Number of segments in the turn
  
      # For each semAnnotation in the Turn
      for semAnnotation in turn.getElementsByTagName("semAnnotation"):
          # We only process HC
          if semAnnotation.getAttribute("withContext") == "false":
              # For each sem
              for sem in semAnnotation.getElementsByTagName("sem"):
                  # Check concept
                  concept = sem.getAttribute("concept")
                  specif = sem.getAttribute("specif")
                  if method == "full" and specif != "null":
                      concept += specif
  
                  # For each transcription in the Turn
                  for transcription in sem.getElementsByTagName(
                      "transcription"
                  ):
                      # Check for sync or text
                      for node in transcription.childNodes:
                          # Check transcription
                          if (
                              node.nodeType == node.TEXT_NODE
                              and node.data.replace("\n", "").replace(
                                  " ", ""
                              )
                              != ""
                          ):
                              (
                                  sentences,
                                  has_speech,
                                  sync_waiting,
                                  concept_open,
                              ) = process_text_node(
                                  node,
                                  sentences,
                                  sync_waiting,
                                  has_speech,
                                  concept,
                                  concept_open,
                                  task,
                                  n,
                                  time_end,
                              )
  
                          # Check Sync times
                          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,
                              )
  
                  if task == "slu":
                      (
                          sentences,
                          concept,
                          concept_open,
                          has_speech,
                          sync_waiting,
                          n,
                      ) = process_semfin_node(
                          sentences,
                          sync_waiting,
                          has_speech,
                          concept,
                          concept_open,
                          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 6 for calling a global function with example usage: parse_sentences(turn, time_beg, time_end, method, task) and returns: sentences