utils.py 295 Bytes
def yield_corpus(df_list):
    for corpus in df_list:
        for id,doc in corpus.iterrows():
            try:
                yield tok2.tokenize(doc[2].decode("utf-8"))
            except:
                print doc[2]
                raise
def select(elm):
    return int(elm.split("_")[-1])