def column_parser(text_column):
  """
  Returns a parser which parses a row of a csv file
  containing labeled data, extracting the label
  and the text

  This parser assumes the label is the zeroth element
  of the row, and the text is the 'text_column' element
  """

  def f(row):
    return int(row[0]), row[text_column]

  return f