自然语言处理(NLP) 三:词袋模型 + 文本分类

1.词袋模型

(BOW,bag of words)
用词频矩阵作为每个样本的特征
Are you curious about tokenization ? Let’s see how it works! we need to analyze a couple of sentences with puntuations to see it in action.’
每个单词出现的次数

import nltk.tokenize as tk 
import sklearn.feature_extraction.text as ft 
#ft进行特征抓取
doc = 'the brown dog is running. The black dog is in the black room. Running in the room is forbidden.'
print(doc)
print('-'*
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值