文本数据处理的终极指南【英文文本】

从社交媒体分析到风险管理和网络犯罪保护,处理文本数据已经变得前所未有的重要。

目录

(1)文本数据的基本体征提取
(1.1)词汇数量
(1.2)字符数量
(1.3)平均字长
(1.4)停用词数量
(1.5)特殊字符数量
(1.6)数字数量
(1.7)大写字母数量
(2)文本数据的基本预处理
(2.1)小写转换
(2.2)去除标点符号
(2.3)去除停用词
(2.4)去除频现词a>
(2.5) 去除稀疏词
(2.6)拼写校正
(2.7)分词(tokenization)
(2.8)词干提取(stemming)
(2.9)词形还原(lemmatization)
(3)高级文本处理
(3.1)N-grams语言模型
(3.2)词频
(3.3)逆文档频率
(3.4)TF-IDF
(3.5)词袋
(3.6)情感分析
(3.7)词嵌入

------------------------------------------------------分割线-----------------------------------------------------

(1)文本数据的基本体征提取

开始之前,我们使用pandas将数据集加载进来,以便后面其他任务的使用,数据集是Twitter情感文本数据集

import pandas as pd
train=pd.read_csv("files/data/python46-data/train_E6oV3lV.csv")
print(train.head(10))
   id  label                                              tweet
0   1      0   @user when a father is dysfunctional and is s...
1   2      0  @user @user thanks for #lyft credit i can't us...
2   3      0                                bihday your majesty
3   4      0  #model   i love u take with u all the time in ...
4   5      0             factsguide: society now    #motivation
5   6      0  [2/2] huge fan fare and big talking before the...
6   7      0   @user camping tomorrow @user @user @user @use...
7   8      0  the next school year is the year for exams.ð��...
8   9      0  we won!!! love the land!!! #allin #cavs #champ...
9  10      0   @user @user welcome here !  i'm   it's so #gr...
  • 3
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值