Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wo/opp-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
wo committed Jul 7, 2016
2 parents 43fb194 + 4deb747 commit e7f0c47
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions opp/blogpostprocessor.py
Expand Up @@ -53,14 +53,15 @@ def process_blogpost(doc):
doc.hidden = True

# categorize:
for (cat_id, cat) in categories():
clf = classifier.get_classifier(cat)
try:
strength = int(clf.classify(doc) * 100)
debug(3, "%s score %s", cat, strength)
except UntrainedClassifierException as e:
continue
doc.assign_category(cat_id, strength)
if doc.numwords > 1000:
for (cat_id, cat) in categories():
clf = classifier.get_classifier(cat)
try:
strength = int(clf.classify(doc) * 100)
debug(3, "%s score %s", cat, strength)
except UntrainedClassifierException as e:
continue
doc.assign_category(cat_id, strength)

doc.found_date = datetime.now()
doc.status = 1
Expand Down

0 comments on commit e7f0c47

Please sign in to comment.