hankcs / hankcs/AveragedPerceptronPython

这里的`train`是更新条件遗漏了吗?

Offen
#1 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
Python
Sterne
50
Forks
29
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

你好,我想请教一下[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 from the guesses, not the
# true tags
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start with the linked article's “搜索” section and the shown train function, then compare the stated update condition with the displayed call. Inspect the repository implementation and related discussion to determine whether the unconditional-looking update is intentional or an omission; done means a confirmed explanation and, if needed, a clearly scoped correction.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
machine-learning
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.