x = ['this is a foo bar', 'you are a foo bar black sheep']

def words_and_char_bigrams(text):
    words = re.findall('\\w{3,}', text)
for w in words:
    yield w
for i in range(len(w) - 2):
    yield w[i:i + 2]
v = CountVectorizer(analyzer=words_and_char_bigrams)
pprint(v.fit(x).vocabulary_)
Как использовать sklearn CountVectorizer с анализатором слов и символов? - питон