【发布时间】:2019-09-07 17:28:00
【问题描述】:
这是一个两部分代码问题。
1.) 需要对客户评论的 csv 文件执行情绪分析。
2.) 需要对保存为 .txt 的哈利波特书评进行情感分析
1.) 这个 Dataframe 的名称是“reviews”,我想做的是在“sent”列下显示这 5 条评论中每条评论的情绪分数。非常感谢!!!如果您可以为代码提供“已发送”列,并为每一行填充其情绪分析分数,那就太棒了!
reviews.head()
ID Customer Name Review Sent
1 Jack Beautiful cover up. My only
feedback is that it is a tad larger
than expected, but since it's a cover
up, it doesn't need to be fitted. The
waist tassels also allow you to adjust
to fit your waist which is nice.
Otherwise, its exactly as expected!
2 Rachel This tunic is very cute in person. It's
more sheer than I'd like, but I imagine
I'll wear it a ton on vacation.
3 Ryan Just got this sweet little dress in
blue. It's a great little dress for a
pool cover up. I can envision myself
wearing it on our winter getaway for
breakfast or on a walk. I'm not sure how
see through it is. I think I could get
away wearing it as a dress. The length
is great, not too short. The quality is
great. I got a size S. Fits true to size.
I am usually a size 2, 34b, 129lb, slim
build. Very happy with this.
4 Jennifer Love this hat! Kept the sun off my face
and neck/chest in the intense tropical
sun! Choose white - so I stayed cool.
5 Alex What I like about bikinis is that they
always fit you perfectly. You won't
realize how gorgeous they are and how
attractive they make your body look
until you put one on. As for the bra-part
it gives good support and sits well. I
also like the fabric: it stretches well
without losing its shape, the color
doesn't fade. This bikini is no exception.
is far better at making bikinis than
anybody else, I would say!
对于这个字符串,我只是想知道整体情绪得分是多少...谢谢!!
2.)
“家长需要知道《哈利波特与魔法石》是一个惊险刺激的故事,是 J.K. 罗琳的哈利波特系列中的第一个。它尊重孩子的智力,并激励他们解决更大的长度和复杂性,玩耍富有想象力的游戏,并尝试解决其逻辑谜题。它是该系列中最轻的,但对于敏感的读者来说,它仍然有一些可怕的东西:三头狗,攻击巨魔,暴力真人大小的棋盘,蒙面人物关于一只死去流血的独角兽,以及关于哈利的父母多年前是如何去世的讨论。”
【问题讨论】:
标签: python nlp sentiment-analysis