【发布时间】:2019-12-11 11:27:21
【问题描述】:
我在字符串上使用 Sk Learn CountVectorizer,但 CountVectorizer 丢弃了文本中的所有表情符号。
例如,???? Welcome 应该给我们:["\xf0\x9f\x91\x8b", "welcome"]
但是,运行时:
vect = CountVectorizer()
test.fit_transform(['???? Welcome'])
我只得到:["welcome"]
这与token_pattern 不把编码的表情符号算作一个单词有关,但是有没有自定义的token_pattern 来处理表情符号?
【问题讨论】:
标签: python scikit-learn nlp countvectorizer