def to_bow(plain_text_doc, dict, preproc, model=None):
    """
    Convert plain-text doc into Gensim BoW format (list of (token_id, token_count))
    using, maybe, some transformation model
    """
    if model:
        return model[dict.doc2bow(preproc.proc(plain_text_doc))]
    else:
        return dict.doc2bow(preproc.proc(plain_text_doc))