MALLET: a Java toolbox for text classification, sequence tagging and topic models
MALLET is a Java-based package for statistical natural language processing, document classification, clustering, topic modeling, information extraction, and other machine learning applications to text.
At a glance
- What is it?
- MALLET is a Java package for statistical natural language processing whose distinguishing feature is that the algorithms are wired together through a pipe system, so tokenising, stopword removal, feature counting and model training are stages in one pipeline rather than separate libraries you have to glue. Version 2.1.0 moved it to Java 17 with reduced dependencies, and 2.1.1 is a faster LDA sampler.
- Who is it for?
- MALLET fits a Java team doing classical text analysis, document classification, named entity extraction or LDA topic modelling that wants a single well documented package with a working command line and an API rather than a set of stitched together libraries, and who can live with the JVM. It is the wrong choice if you need modern transformer based language models, and it is the wrong choice if you cannot accept a dependency on a Java runtime in your pipeline.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 95 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 7, 2026, and from our analysis. They are not legal advice.
Star history
- mimno/Mallet1,033 ★ · +1
| Repository | 2026-10-19 | 2026-11-07 |
|---|---|---|
| mimno/Mallet | 1k | 1k |
1 Stars in the last 19 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The pipe system, which is the actual design of the library
MALLET is a Java-based package for statistical natural language processing, document classification, clustering, topic modeling, information extraction, and other machine learning applications to text. The homepage is mimno.github.io/Mallet.
What makes it more than a collection of algorithms is the pipe system. MALLET includes routines for transforming text documents into numerical representations that can then be processed efficiently, and this process is implemented through a flexible system of pipes, which handle distinct tasks such as tokenizing strings, removing stopwords, and converting sequences into count vectors.
That is the architectural decision, and it is the one worth understanding before you look at any algorithm. A MALLET pipeline is a chain where each stage consumes what the previous one produced, and the stages are swappable. Tokenise, then remove stopwords, then count, then train, then evaluate, and any stage can be replaced or skipped. The stoplists/ directory in the repository listing is where the stopword lists live, which tells you that the stopword removal stage is a configuration point rather than a hardcoded behaviour.
The feature conversion step is the one that matters most in practice. A great deal of the classic text classification literature is about how you turn documents into vectors, and MALLET treats that as a first class stage in the pipeline, with efficient routines for it, rather than leaving you to improvise.
The algorithm list in the documentation shows the breadth. Topic modelling includes LDA, Parallel LDA, DMR LDA, Hierarchical LDA, Labeled LDA, Polylingual Topic Model, Hierarchical Pachinko Allocation Model, Weighted Topic Model, LDA with integrated phrase discovery, and word embeddings using word2vec with skip-gram and negative sampling. Classification includes AdaBoost, Bagging, Winnow, C45 Decision Tree, an Ensemble Trainer, Maximum Entropy Classifier described as Multinomial Logistic Regression, Naive Bayes, Rank Maximum Entropy Classifier, and Posterior Regularization Auxiliary Model. Clustering covers Greedy Agglomerative, Hill Climbing, K-Means and K-Best. Sequence prediction includes Conditional Random Fields, Maximum Entropy Markov Models, Hidden Markov Models and semi-supervised variants, and there is linear regression as well.
Many of those algorithms depend on numerical optimisation, and MALLET includes an efficient implementation of Limited Memory BFGS among many other optimisation methods, which is the piece that makes the higher cost models usable at scale.
The toolkits: classification, sequence tagging and topic models
Three capability groups are described in detail, and each has its own machinery.
For document classification, MALLET includes sophisticated tools: efficient routines for converting text to features, a wide variety of algorithms including Naive Bayes, Maximum Entropy and Decision Trees, and code for evaluating classifier performance using several commonly used metrics. The evaluation code is the part that separates MALLET from a bare algorithm collection, because a classifier without a way to measure it is a demo rather than a tool.
For sequence tagging, for applications such as named-entity extraction from text, the algorithms are Hidden Markov Models, Maximum Entropy Markov Models and Conditional Random Fields, and they are implemented in an extensible system for finite state transducers. That extension point is significant, because a domain specific entity type almost always means a new state or a new feature and the transducer system is where you would add it.
For topic models, the framing is analyzing large collections of unlabeled text, and the toolkit contains efficient, sampling-based implementations of Latent Dirichlet Allocation, Pachinko Allocation and Hierarchical LDA. The word sampling-based is doing real work, since it distinguishes these from variational implementations and explains why the parameters that matter are the number of iterations and the burn-in period.
There is also a separate add-on package, GRMM, which contains support for inference in general graphical models and training of CRFs with arbitrary graphical structure. That is the extension that turns a fixed CRF into a general sequence labeller, and it is a separate artifact rather than part of the core, which tells you the core does not want to carry the dependency.
The scale claim is also worth noting, since it is the reason a package like this exists rather than a set of scikit-learn calls. MALLET was initially developed for large scale text processing, and the word embeddings entry, word2vec with skip-gram and negative sampling, is there because MALLET is used on corpora where running a separate embedding step over the whole collection is a large part of the cost.
Building it: Java 17, Maven, and the version history that explains the change
The prerequisites are Java 17 or higher and Maven 3.6 or higher, and the release notes explain why they moved.
The v2.1.0 release, dated 2026-01-08, is titled Release 2.1.0 - Java 17, reduced dependencies. The v2.1.1 release, dated 2026-08-04, is titled Release 2.1.1 - Faster LDA sampling. Before those there is a v202108 tag from 2021-08-11, and the gap between a 2021 tag and a 2026 release tells you the project spent a while on a long overdue version bump.
On macOS the documentation warns that the default Java installation is often outdated and recommends installing OpenJDK via Homebrew:
brew install openjdk mavenAfter installation you follow the instructions printed by Homebrew to add OpenJDK to your PATH, or add this to your shell configuration file, for example ~/.zshrc:
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"And then you verify with java --version.
The build from source is one command:
mvn packagewhich compiles the code, runs tests, and creates a JAR file in the target/ directory. The build command table lists the variations, mvn compile to compile the source, mvn test to run all tests, mvn package to build the JAR file including tests, mvn package -DskipTests to skip the tests, mvn install to install to the local Maven repository, and mvn javadoc:javadoc to generate the API documentation.
The reduced dependencies in 2.1.0 is worth pausing on, because it is the kind of change that matters to anyone who has fought a dependency tree. A statistical package that pulls in a large set of numerical and parsing libraries is a common source of version conflicts, and trimming that in a major release is work that benefits every downstream user.
The project is not archived, the last push was on 2026-08-04, the same day as the 2.1.1 release, and the default branch is master.
Using it as a dependency, and the command line
MALLET is consumed either as a Maven artifact or through the command line, and the two are the same codebase.
The Maven coordinates are:
<dependency>
<groupId>cc.mallet</groupId>
<artifactId>mallet</artifactId>
<version>2.1.1</version>
</dependency>Note the group id, cc.mallet, which is the old MALLET group and not the reverse DNS of the GitHub organisation. The repository is under mimno/Mallet, and the older build badge in the README still points at the MNCC/Mallet path on Travis CI, so the project has moved hosts at least once and the coordinates are the stable thing to write down.
The command line interface follows the same convention as most Unix tools, and the usage line is:
bin/mallet [command] --option value --option value ...Type bin/mallet with no arguments to get a list of commands, and use the --help option with any command to get a description of its valid options. The detail of each command is in the API documentation and on the website.
The bin/ directory in the repository listing is where the launcher lives, and it is a shell script rather than a compiled artefact, which is why the same installation serves both the command line and the Maven artifact.
The repository layout also shows a docs/ directory, a sample-data/ directory for example corpora, a lib/ directory alongside src/, a pom.xml at the root, a TESTING.md, a CHANGELOG.md and a baseline-results.txt. That last file is worth noting: it is a stored record of expected output, which is how you detect a change in numerical behaviour when a model implementation changes. In a package full of probabilistic algorithms where the sampler is stochastic, having a baseline is the only way to know whether a refactor changed anything.
The _config.yml file is a GitHub Pages configuration for the project site, and the .travis.yml is the older CI configuration, which is why the build badge in the README points at Travis CI rather than at GitHub Actions.
The licence, and what to check before you build on it
The licence is the one thing here that needs you to actually go and read a file.
The repository records the licence as a custom one that GitHub could not classify, with the terms in a LICENSE file at the root. The README does not summarise those terms anywhere, and for a package with this history, that is worth a few minutes of your own reading rather than an assumption.
Two other things are visible in the repository listing and worth noting for a project of this age. There is a.github/ directory, and some of the automation still lives in the Travis configuration rather than in GitHub Actions.
The licence question matters more here than it would for a small utility, and for a specific reason. MALLET is a package you embed in a pipeline that produces or consumes data, often in a research or analysis context, and the derived artefacts of a statistical pipeline sometimes inherit the licence of the tool. Whether that is true depends entirely on what the LICENSE file says, and the custom classification is a strong hint that the terms are not one of the short permissive licences you might assume from a Java research package.
The other practical consideration is the age of the numerical stack. Version 2.1.0 moved to Java 17 and reduced dependencies, and 2.1.1 improved LDA sampling speed, so the project is being maintained in a way that matters. But the algorithm catalogue is classical statistical NLP, and the word embeddings entry is word2vec, not a transformer. If your requirement is a modern language model, MALLET is not the package, and no amount of its classification and sequence tagging capability changes that. The right question to ask is whether the models you need are in the list, and for a large number of projects today the answer is no.
Editorial conclusion
MALLET fits a Java team doing classical text analysis, document classification, named entity extraction or LDA topic modelling that wants a single well documented package with a working command line and an API rather than a set of stitched together libraries, and who can live with the JVM. It is the wrong choice if you need modern transformer based language models, and it is the wrong choice if you cannot accept a dependency on a Java runtime in your pipeline. Before adopting, check the licence in the LICENSE file, since the repository records a custom licence that GitHub could not classify, and read the algorithm list against what you actually need, because the package is much stronger on classification and topic models than on anything that learned from pretraining.
Frequently asked questions
What is MALLET used for?
It is a Java-based package for statistical natural language processing, covering document classification, clustering, topic modeling, information extraction and other machine learning applications to text. It includes classifiers, sequence taggers for named entity extraction, topic models including LDA, Pachinko Allocation and Hierarchical LDA, and an efficient Limited Memory BFGS optimiser.
What are pipes in MALLET?
Pipes are the stages of MALLET's text processing pipeline. The system handles distinct tasks such as tokenizing strings, removing stopwords and converting sequences into count vectors, and it is what lets you swap or skip a stage when building the numerical representation of a document.
How do I build and use MALLET?
You need Java 17 or higher and Maven 3.6 or higher, then run mvn package, which compiles, runs the tests and produces a JAR in target/. The command line is then bin/mallet [command] --option value, and as a dependency the coordinates are groupId cc.mallet, artifactId mallet.
What changed in the recent MALLET releases?
Version 2.1.0, dated 2026-01-08, moved the project to Java 17 and reduced its dependencies. Version 2.1.1, dated 2026-08-04, is a faster LDA sampler. Before those, the previous tag was v202108 from 2021-08-11.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/mimno-mallet)Star history chart for your README
[](https://hysenlabs.com/projects/mimno-mallet)Was this useful?