Skip to content

mallette 0.1.0

Choose a tag to compare

@dmberry dmberry released this 02 Nov 14:08
· 3 commits to main since this release

The first release of mallette: MALLET's topic model (LDA with hyperparameter optimisation, ParallelTopicModel on one thread) translated into JavaScript, to run in a web browser or in node with no Java and no server.

Given the same documents and the same random seed, mallette gives every token the same topic as MALLET 2.1.1 run with --num-threads 1, and so the same alpha, beta, topic keys and output files.

Checked against MALLET 2.1.1

Corpus Documents Tokens Topics Result
MALLET's sample (web/en) 12 1,245 3, 5, 8, 20; seeds 7, 123, −5, 1; with and without optimisation all assignments, alpha, beta and topic keys identical
Webster's 1913, in 40-line documents 2,000 274,486 20; 400 iterations; optimise every 20 all assignments, alpha, beta and topic keys identical

test/compare.js runs MALLET and mallette on the same file and reports the first difference, if any.

In this release

  • importDocs: MALLET's default token pattern, lower-casing and built-in English stoplist (524 words).
  • TopicModel: estimate(), and estimateAsync() for the browser, which runs in steps of about 40 ms, reports progress and can be cancelled without changing the sequence of random numbers.
  • Output: result(n), and MALLET's own formats from topicKeys(n), docTopics() and state().

Planned: diagnostics, inference for new documents, reading and writing MALLET state files, a Web Worker, speed, a test suite, and an npm package. See the README.

Written for bench-kit. Apache License 2.0, as MALLET; see NOTICE.