Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增TextRank算法 #42

Closed
wants to merge 1 commit into from
Closed

新增TextRank算法 #42

wants to merge 1 commit into from

Conversation

CasyWang
Copy link

@CasyWang CasyWang commented Jul 9, 2015

添加新特性

  1. 添加原生的TextRank算法;

添加新特性
1. 添加原生的TextRank算法;
@yanyiwu
Copy link
Owner

yanyiwu commented Jul 13, 2015

非常感谢你的pr,由于这个周末带我妈出去玩,一直没时间弄这个。我这两天尽快把这个给merge了。

}

/* normalize */
double max_rank = max_element(ws.begin(), ws.end())->second;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的代码有问题吧?

  1. 这里排序比较的应该是 first 值而你想要的却是 second值。
  2. 当ws为空的时候,这个会出现不符合预期,甚至coredump的情况的。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first是Key,在ws这个map里也就是词word, second是value,也就是单词的投票得分word score,stl的map是有就Update,没有就Insert,应该不会出现ws为空的情况下coredump的情况吧?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我说的是99行,就是 max_element 那行,和update或者insert没有关系啊。你回复的好像和我说的不是一回事,还是我没理解对?

@BruceZhaoR
Copy link

@yanyiwu @CasyWang 咋不接着弄下去了呢? 😕

@yanyiwu
Copy link
Owner

yanyiwu commented Mar 18, 2016

@BruceZhaoR 谢谢提醒。这个pr挺好的,可惜当时我指出一些潜在bug之后作者继续修复了。没有达到一个可用merge的状态。我找时间再review一下这个pr,尽可能修改到可merge的状态吧。

@yanyiwu
Copy link
Owner

yanyiwu commented Mar 31, 2016

再review了一下代码,目前还存在不少问题和明显bug,该pr的作者好像已经很久没有在github上活动了。所以这个pr暂且先close掉了。

@yanyiwu yanyiwu closed this Mar 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants