code: def parse_gradio_data(data, input_types):
      """Parses data from gradio Dataframe for use in metric."""
      metric_inputs = {}
      data.replace("", np.nan, inplace=True)
      data.dropna(inplace=True)
      for feature_name, input_type in zip(data, input_types):
          if input_type == "json":
              metric_inputs[feature_name] = [
                  json.loads(d) for d in data[feature_name].to_list()
              ]
          elif input_type == "str":
              metric_inputs[feature_name] = [
                  d.strip('"') for d in data[feature_name].to_list()
              ]
          else:
              metric_inputs[feature_name] = data[feature_name]
      return metric_inputs
  
file_path: evaluate/src/evaluate/utils/gradio.py
imports: import json
  import os
  import re
  import sys
  from pathlib import Path
  import numpy
  from datasets import Value
  from .logging import get_logger
label_desc: Use image node_id 4 for calling a global function with example usage: parse_gradio_data(data, input_types) and returns: metric_inputs