code: def computeDialogue(greedy, answer):
      examples = []
      for idx, (g, a) in enumerate(zip(greedy, answer)):
          examples.append((a[0][0], g, a[0][1], idx))
      examples.sort()
      turn_request_positives = 0
      turn_goal_positives = 0
      joint_goal_positives = 0
      ldt = None
      for ex in examples:
          if (
              ldt is None
              or ldt.split("_")[:-1] != ex[0].split("_")[:-1]
          ):
              state, answer_state = {}, {}
              ldt = ex[0]
          delta_state = to_delta_state(ex[1])
          answer_delta_state = to_delta_state(ex[2])
          state = update_state(state, delta_state["inform"])
          answer_state = update_state(
              answer_state, answer_delta_state["inform"]
          )
          if dict_cmp(state, answer_state):
              joint_goal_positives += 1
          if delta_state["request"] == answer_delta_state["request"]:
              turn_request_positives += 1
          if dict_cmp(
              delta_state["inform"], answer_delta_state["inform"]
          ):
              turn_goal_positives += 1
  
      joint_goal_em = joint_goal_positives / len(examples) * 100
      turn_request_em = turn_request_positives / len(examples) * 100
      turn_goal_em = turn_goal_positives / len(examples) * 100
      answer = [(x[-1], x[-2]) for x in examples]
      answer.sort()
      answer = [[x[1]] for x in answer]
      return joint_goal_em, turn_request_em, turn_goal_em, answer
  
imports: from subprocess import Popen, PIPE, CalledProcessError
  import json
  from text.torchtext.datasets.generic import Query
  import logging
  import os
  import re
  import string
  import numpy
  import collections
  from multiprocessing import Pool, cpu_count
  from contextlib import closing
  from pyrouge import Rouge155
  from sacrebleu import corpus_bleu
label_desc: Use image node_id 19 for calling a global function with example usage: computeDialogue(greedy, answer) and returns: joint_goal_em,  turn_request_em,  turn_goal_em,  answer