Python 过滤字符串中的emoji
使用python环境过滤文本当中的emoji表情在使用spark处理用户评论时发现大量的ermoji无效表情,几乎不能作为有效评论,所以需要删除其中的无用emoji表情方法一需要先导入 emoji 包,然后通过写好的 give_emoji_free_text 函数操作pip install emojiimport emojidef give_emoji_free_text(text): allchars = [str for str in text.decode('utf-8')]


