AveragedPerceptronPython icon indicating copy to clipboard operation
AveragedPerceptronPython copied to clipboard

Clone of "A Good Part-of-Speech Tagger in about 200 Lines of Python" by Matthew Honnibal

Results 3 AveragedPerceptronPython issues
Sort by recently updated
recently updated
newest added

您好,请问[200行Python代码实现感知机词性标注器](http://www.hankcs.com/nlp/averaged-perceptron-tagger.html) 中求平均权重的思路与[这篇文章第10页中](http://www.umiacs.umd.edu/~hal/docs/daume06thesis.pdf)返回平均权重的思路有何不同呢?我现在比较困惑,烦请您解答一下^_^

你好,我想请教一下[200行Python代码实现感知机词性标注器](http://www.hankcs.com/nlp/averaged-perceptron-tagger.html)中【搜索】哪一节中`train`函数的一个问题: 文中前端说的是,当`guess != true_tag`时就更新权重(犯错时),第一个`train`出现的时候。可是【搜索】这一段中却总是在更新,是遗漏了吗? ``` guess = self.tagdict.get(word) if not guess: feats = self._get_features( i, word, context, prev, prev2) guess = self.model.predict(feats) self.model.update(tags[i], guess, feats) # Set the history features...

question

AveragedPerceptron.py的96~97行,model.predict(features)中返回的是guess_tag,而不是每个tag对应的评分: ``` scores = model.predict(features) guess, score = max(scores.items(), key=lambda i: i[1]) if guess != class_: model.update(class_, guess, features) ``` 是不是应该这样: ``` guess = model.predict(features) if guess != class_: model.update(class_,...