Skip to content

Classify text using Stanford's Core NLP with Sista NLP wrappers

Notifications You must be signed in to change notification settings

samuelkdavis-mccarthyfinch/basic-core-nlp

 
 

Repository files navigation

basic-open-nlp

Classify text using Stanford's Open NLP with Sista NLP Scala wrappers

This basic system takes in a text file with each line in tab-delimited format {class document_text}: training.txt

...
Cooking  How do I make a good tomato sauce for pizza?
Gardening  Why are my cherry tomatoes dying?

Instantiate via

val textClassifier = new TextClassifier("training.txt")

Unknown text can be classified using:

val (classification, score) = textClassifer.classify("I wonder what class these tomatoes will fall into...")

That's it. Be careful. There is zero input checking and no exception handling.

To run:

sbt "run training100.txt"
sbt "run training1000.txt"

Be sure to use quotes so SBT recognizes the second word as part of the command (in this case, the file with training data).

About

Classify text using Stanford's Core NLP with Sista NLP wrappers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%