Stanford Word Segmenter

Download | Mailing Lists | Release history

Tokenization of raw text is a standard pre-processing step for many NLP tasks. For English, tokenization usually involves punctuation splitting and separation of some affixes like possessives. Other languages require more extensive token pre-processing, which is usually called segmentation.

The Stanford Word Segmenter currently supports Arabic and Chinese. The provided segmentation schemes have been found to work well for a variety of applications.

The system requires Java 1.6+ to be installed. We recommend at least 1G of memory for documents that contain long sentences. For files with shorter sentences (e.g., 20 tokens), decrease the memory requirement by changing the option java -mx1g in the run scripts.

Arabic

Arabic is a root-and-template language with abundant bound morphemes. These morphemes include possessives, pronouns, and discourse connectives. Segmenting bound morphemes reduces lexical sparsity and simplifies syntactic analysis.

The Arabic segmenter model processes raw text according to the Penn Arabic Treebank 3 (ATB) standard. It is a stand-alone implementation of the segmenter described in:

Spence Green and John DeNero. 2012. A Class-Based Agreement Model for Generating Accurately Inflected Translations. In ACL.

Chinese

Chinese is standardly written without spaces between words (as are some other languages). This software will split Chinese text into a sequence of words, defined according to some word segmentation standard. It is a Java implementation of the CRF-based Chinese Word Segmenter described in:

Huihsin Tseng, Pichuan Chang, Galen Andrew, Daniel Jurafsky and Christopher Manning. 2005. A Conditional Random Field Word Segmenter. In Fourth SIGHAN Workshop on Chinese Language Processing.

Two models with two different segmentation standards are included: Chinese Penn Treebank standard and Peking University standard.

On May 21, 2008, we released a version that makes use of lexicon features. With external lexicon features, the segmenter segments more consistently and also achieves higher F measure when we train and test on the bakeoff data. This version is close to the CRF-Lex segmenter described in:

Pi-Chuan Chang, Michel Galley and Chris Manning. 2008. Optimizing Chinese Word Segmentation for Machine Translation Performance. In WMT.
The older version (2006-05-11) without using external lexicon features will still be available for download. But we do recommend using the latest version (2012-05-07).

Another new feature of the latest release is that the segmenter can now output k-best segmentations. An example of how to train the segmenter is now also available.

Download

The segmenter is available for download, licensed under the GNU General Public License (v2 or later). Source is included. The package includes components for command-line invocation and a Java API. The segmenter code is dual licensed (in a similar manner to MySQL, etc.). Open source licensing is under the full GPL, which allows many free uses. For distributors of proprietary software, commercial licensing with a ready-to-sign agreement is available. If you don't need a commercial license, but would like to support maintenance of these tools, we welcome gift funding.

The download is a gzipped tar file mainly consisting of model files. If you unpack the tar file, you should have everything needed. Simple scripts are included to invoke the segmenter.

Download Stanford Word Segmenter version 2012-05-07 (First Arabic release!)

Download Stanford Chinese Segmenter version 2012-01-08

Download Stanford Chinese Segmenter version 2011-09-14

Download Stanford Chinese Segmenter version 2011-06-19

Download Stanford Chinese Segmenter version 2008-05-21 (with external lexicon features; able to output k-best segmentations)

Download Stanford Chinese Segmenter version 2006-05-11 (with no external lexicon features)

Known Issues

The 2012 (and perhaps earlier) releases have a bug in which they do not use a specified file encoding in all places. In particular, the recommended way to use the tagger is to use utf-8 encoding, which is the default. If that is also your platform default encoding (Linux, Windows), then you need do nothing more. For running the software on a Mac (where the Java platform default encoding is still MacRoman, for who knows what reason), then you will need to give Java the flag:

java -Dfile.encoding=utf-8

We will fix this in a future release.

Mailing Lists

We have 3 mailing lists for the Stanford Word Segmenter, all of which are shared with other JavaNLP tools (with the exclusion of the parser). Each address is at @lists.stanford.edu:

  1. java-nlp-user This is the best list to post to in order to ask questions, make announcements, or for discussion among JavaNLP users. You have to subscribe to be able to use it. Join the list via this webpage or by emailing java-nlp-user-join@lists.stanford.edu. (Leave the subject and message body empty.) You can also look at the list archives.
  2. java-nlp-announce This list will be used only to announce new versions of Stanford JavaNLP tools. So it will be very low volume (expect 1-3 message a year). Join the list via via this webpage or by emailing java-nlp-announce-join@lists.stanford.edu. (Leave the subject and message body empty.)
  3. java-nlp-support This list goes only to the software maintainers. It's a good address for licensing questions, etc. For general use and support questions, please join and use java-nlp-user. You cannot join java-nlp-support, but you can mail questions to java-nlp-support@lists.stanford.edu.

Release History


VersionDateDescription
1.6.4 2012-05-07 Included Arabic model
1.6.3 2012-01-08 Minor bug fixes
1.6.2 2011-09-14 Improved thread safety
1.6.1 2011-06-19 Fixed empty document bug when training new models
1.6 2011-05-15 Models updated to be slightly more accurate; code correctly released so it now builds; updated for compatibility with other Stanford releases
1.5 2008-05-21 (with external lexicon features; able to output k-best segmentations)
1.0 2006-05-11 Initial release