Skip to content
a text classification and processing library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is currently the beginning of a text classification library.


stack install hext

hackage -

To run:
stack build
stack exec hext-exe


Currently, the only algorithm implementation is the Naive Bayes algorithm: to run your own data through this algorithm in order to classify your text, you need:

  • classified data: this can be sourced from a database where the only fields that are needed are the text itself, and it's class
  • a sample string which will be classified by the algorithm

In order to run the program, the classified data specified above must be converted into a BayesModel a using the teach function, where a is your own defined data type representing the class to classify your text. Your class must be and instance of Ord and Eq.

With your new BayesModel filled with knowledge, it's time to classify your text using runBayes. An example of this can be seen in app/Main.hs where data Class = Positive | Negative deriving (Eq, Ord, Show) to label movie reviews as either positive or negative.


I encourage contributing to this package, in the form of implementing algorithms that are not yet in the project, improving efficiency, or the like.

You can’t perform that action at this time.