def prepare_entry(rv, date=None, rvid=None, rating=None): entry = dict() # start = time.time() if date is not None: entry["date"] = date if rvid is not None: entry["review_id"] = rvid if rating is not None: entry["review_score"] = rating entry['mention'] = rv question_toks = CSV.process_nl(rv) entry['input_tokens'] = question_toks # print("- TIMING: %.4f seconds for NL tokenization" % (time.time() - start)) return entry
def prepare_nls(nls): data = [] for nl in nls: data.append((CSV.process_nl(nl), None)) return data