楼主: gnijuohz
跳转到指定楼层
上一主题 下一主题
收起左侧

UW Introduction to Data Science Week1讨论加号召报名帖

🔗
 楼主| gnijuohz 2013-5-13 11:15:17 | 只看该作者
全局:
小K 发表于 2013-5-13 11:11
eg. good =3, not good= -2, then "my day is not good" should count only -2?

啊啊~应该算-2吧,可是这么说我得代码把它算成3了啊。

这都通过了。。。
回复

使用道具 举报

🔗
modifiedname 2013-5-13 11:16:00 | 只看该作者
全局:
只有很少几个含空格的短语,我考虑先去match那几个短语,记下谁能被match
then split to words
如果split以后的单词不在短语key里, 就加上,
如果在短语中,则不添加
回复

使用道具 举报

🔗
modifiedname 2013-5-13 11:16:32 | 只看该作者
全局:
那就是brute force凡是含有的全部统统加上?
回复

使用道具 举报

🔗
 楼主| gnijuohz 2013-5-13 11:24:52 | 只看该作者
全局:
小K 发表于 2013-5-13 11:16
那就是brute force凡是含有的全部统统加上?

恩。我刚才去forum搜了下有关phrase的帖子发现大多数人都没考虑phrase。不过有个人的方法感觉不错:

I had an elaborate process of building a list of phrases from the file (phrases were identified by spaces), dealing with them in the tweet first, then getting rid of them to avoid double counting the words that make up the phrase. I suspect none of that is needed to pass this grader & suggest try just treating them like the other sentiment terms.


他先单独把phrase放到一个list然后在每个tweet里面找phrase,找到了再把该词从tweet里去掉,然后再计算剩下的分数。感觉这个approach更合理但grader貌似很松。。。这样不知道会不会反而错。

在这:https://class.coursera.org/datas ... t_id=4818#post-4833
回复

使用道具 举报

🔗
modifiedname 2013-5-13 11:27:35 | 只看该作者
全局:
明白了,make sense比我说的办法合理。。


对了regex不熟啊。。。。为什么下面这段找不到match呢?


p = re.compile(r'good')
m = p.match( 'not good' )
if m:
    print 'Match found: ', m.group()
else:
    print 'No match'
回复

使用道具 举报

🔗
modifiedname 2013-5-13 11:28:37 | 只看该作者
全局:
标点符号要怎么搞?don't like 就不会被识别成dont like呀。。。。
回复

使用道具 举报

🔗
 楼主| gnijuohz 2013-5-13 11:35:08 | 只看该作者
全局:
小K 发表于 2013-5-13 11:27
明白了,make sense比我说的办法合理。。

Python offers two different primitive operations based on regular expressions: match checks for a match only at the beginning of the string, while search checks for a match anywhere in the string (this is what Perl does by default).

所以用search应该可以吧~
回复

使用道具 举报

🔗
 楼主| gnijuohz 2013-5-13 11:36:20 | 只看该作者
全局:
小K 发表于 2013-5-13 11:28
标点符号要怎么搞?don't like 就不会被识别成dont like呀。。。。

提交作业时先不考虑phrase吧。。。grader不够成熟的感觉。。。
回复

使用道具 举报

无效楼层,该帖已经被删除
🔗
modifiedname 2013-5-13 11:42:56 | 只看该作者
全局:
gnijuohz 发表于 2013-5-12 22:35
Python offers two different primitive operations based on regular expressions: match checks for a  ...

got it, thanks!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表