'Automatically removes words with digits in them, hyperlink and in-vocab-words.'

def _remove_in_vocab_words_from_sentence(self, example):

    cleaned_tokens = []
    for token in example.get(u'spacy_doc'):
        if ((not token.has_vector) and (not token.like_url) and (not token.like_num) and (not token.like_email) and (not token.is_punct)):
            cleaned_tokens.append(token)
    non_words = u'    '.join([t.text for t in cleaned_tokens])
    non_words = u''.join([letter for letter in non_words if (not letter.isdigit())])
    non_words = u'    '.join([word for word in non_words.split(u'    ') if (word != u'')])
    return non_words
