【发布时间】:2020-12-09 23:06:02
【问题描述】:
我正在对这些数据进行预处理:
Name Nickname Age Country Reg_Date Text
Matt LeBron 63 Canada 24-12-2008 I'm in a happy mood today. I go to beach
Chris Severine 54 U.S. 15-07-2009 I stand in solidarity with #ows
Lucas Daly 47 Ireland 01-05-2020 Trump is working for next politician...
Clash Lynch 24 U.S. 13-11-2008 What a wonderful day!
...
在将我的数据集拆分为训练集和测试集并将其用于逻辑回归之前,我需要使用词袋或其他特征表示。
目前我试图从上面的原始数据集中获取其他信息(推文中的字符数;标点符号的使用等):
Name Nickname Age Country Reg_Date Text
Matt LeBron 63 Canada 24-12-2008 I'm in a happy mood today. I go to beach
Chris Severine 54 U.S. 15-07-2009 I stand in solidarity with #ows
Lucas Daly 47 Ireland 01-05-2020 Trump is working with Putin...
Clash Lynch 24 U.S. 13-11-2008 What a wonderful day!
...
Lulu Lulu22 18 Poland 02-09-2019 I hate Maths!!!! >(
Punctuation Positive Words Negative Words
[.] [happy] []
[#] [solidarity] []
[...] [] []
[!] [wonderful] []
[>,(] [] [hate]
现在,我真的很想了解如何以模型“可读”的方式(例如在逻辑回归模型中)转换标点符号信息、肯定词、否定词、文本。
如果您能给我一些有用的提示或提供示例,我将不胜感激。
【问题讨论】:
标签: python nlp logistic-regression