add metadata so that probabilities for document categories can be utilized. #14

Merged
merged 2 commits into from May 19, 2012

Projects

None yet

2 participants

@daviddpark
Contributor

changed return value of function from string 'BESTCATEGORY' to a map object so that metadata could be added
tests added as appropriate.

@daviddpark daviddpark add metadata so that probabilities for document categories can be uti…
…lized. changed return value of function from string 'BESTCATEGORY' to a map object so that metadata could be added
7c5db45
@dakrone dakrone and 1 other commented on an outdated diff May 19, 2012
src/opennlp/nlp.clj
@@ -192,5 +199,8 @@
{:pre [(string? text)]}
(let [categorizer (DocumentCategorizerME. model)
outcomes (.categorize categorizer text)]
- (.getBestCategory categorizer outcomes))))
-
+ (with-meta
+ {:best_category (.getBestCategory categorizer outcomes)}
dakrone
dakrone May 19, 2012 Owner

idiomatic clojure is hyphens instead of underscores, how about :best-category?

daviddpark
daviddpark May 19, 2012 Contributor

Good catch, Lee. Thanks. Resolved, updated pull request.

On Sat, May 19, 2012 at 3:43 PM, Lee <
reply@reply.github.com

wrote:

@@ -192,5 +199,8 @@
{:pre [(string? text)]}
(let [categorizer (DocumentCategorizerME. model)
outcomes (.categorize categorizer text)]

- (.getBestCategory categorizer outcomes))))

  •  (with-meta
    
  •    {:best_category (.getBestCategory categorizer outcomes)}
    

idiomatic clojure is hyphens instead of underscores, how about
:best-category?


Reply to this email directly or view it on GitHub:
https://github.com/dakrone/clojure-opennlp/pull/14/files#r849801

David Park
(m) +1.317.270.4287
daviddpark at gmail dot com

@dakrone dakrone merged commit b9ba191 into dakrone:master May 19, 2012
Owner
dakrone commented May 19, 2012

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment