Initialize the corpus from a file. labels (bool) - whether labels are present in the input file.
IndexedCorpus.__init__(self, fname)
logger.info("loading corpus from %s" % fname)
self.fname = fname // input file, see class doc for format
self.length = None
After Change
self.labels = labels
// load the first few lines, to guess the CSV dialect
head = "".join(itertools.islice(open(self.fname), 5))
self.headers = csv.Sniffer().has_header(head)
self.dialect = csv.Sniffer().sniff(head)
logger.info("sniffed CSV delimiter=%r, headers=%s" % (self.dialect.delimiter, self.headers))