Hostname: page-component-74656f9884-rngvg Total loading time: 0 Render date: 2026-11-05T18:45:14.985Z Has data issue: false hasContentIssue false

Comparison of text preprocessing methods

Published online by Cambridge University Press:  13 June 2022

Christine P. Chai*
Affiliation:
Microsoft Corporation, One Microsoft Way, Redmond, WA 98052, USA
Rights & Permissions [Opens in a new window]

Abstract

Text preprocessing is not only an essential step to prepare the corpus for modeling but also a key area that directly affects the natural language processing (NLP) application results. For instance, precise tokenization increases the accuracy of part-of-speech (POS) tagging, and retaining multiword expressions improves reasoning and machine translation. The text corpus needs to be appropriately preprocessed before it is ready to serve as the input to computer models. The preprocessing requirements depend on both the nature of the corpus and the NLP application itself, that is, what researchers would like to achieve from analyzing the data. Conventional text preprocessing practices generally suffice, but there exist situations where the text preprocessing needs to be customized for better analysis results. Hence, we discuss the pros and cons of several common text preprocessing methods: removing formatting, tokenization, text normalization, handling punctuation, removing stopwords, stemming and lemmatization, n-gramming, and identifying multiword expressions. Then, we provide examples of text datasets which require special preprocessing and how previous researchers handled the challenge. We expect this article to be a starting guideline on how to select and fine-tune text preprocessing methods.

Information

Type
Survey Paper
Copyright
© The Author(s), 2022. Published by Cambridge University Press
Figure 0

Figure 1. A common order of application of the text preprocessing modules.

Figure 1

Figure 2. Postprocessing after using the NLTK tokenizer reduces the tokenization errors. The data are from Table 1 in Grön and Bertels (2018).

Figure 2

Table 1. Number and percentage of false positives for each type of pattern matching. The data are from Table 3 in Cohen et al. (2002), and the rows after the first one refer to the extra tokens discovered beyond strict pattern matching

Figure 3

Figure 3. Tokenization decisions in the gene “alpha-2-macroglobulin” lead to different pattern matching results. The data are from Table 2 in Cohen et al. (2002).

Figure 4

Figure 4. Hierarchical structure of a sentence with or without a comma. The sentence example is from Truss (2004).

Figure 5

Figure 5. Illustration of the Zipf’s law (Zipf 1949).

Figure 6

Table 2. The n-gram statistics of Wuthering Heights