def file_generator(reader):
    """
    Convert a document into ids based on given vocabulary
    :param Iterator[str,int] reader: csv file reader iterator
    :rtype: Iterator[str,int]
    """
    for row_label, row_text in reader:
        yield row_label, row_text
