Is Word Segmentation Necessary for Deep Learning of Chinese Representations?

Segmenting a chunk of text into words is usually the first step of processing Chinese text, but its necessity has rarely been explored. In this paper, we ask the fundamental question of whether Chinese word segmentation (CWS) is necessary for deep learning-based Chinese Natural Language Processing. We benchmark neural word-based models which rely on word segmentation against neural char-based models which do not involve word segmentation in four end-to-end NLP benchmark tasks: language modeling, machine translation, sentence matching/paraphrase and text classification. Through direct comparisons between these two types of models, we find that char-based models consistently outperform word-based models. Based on these observations, we conduct comprehensive experiments to study why word-based models underperform char-based models in these deep learning-based NLP tasks. We show that it is because word-based models are more vulnerable to data sparsity and the presence of out-of-vocabulary (OOV) words, and thus more prone to overfitting. We hope this paper could encourage researchers in the community to rethink the necessity of word segmentation in deep learning-based Chinese Natural Language Processing.


Introduction
There is a key difference between English (or more broadly, languages that use some form of the Latin alphabet) and Chinese (or other languages that do not have obvious word delimiters such as Korean and Japanese) : words in English can be easily recognized since the space token is a good approximation of a word divider, whereas no word divider 1 Yuxian Meng and Xiaoya Li contribute equally to this paper.
2 Paper to appear at ACL2019.
is present between words in written Chinese sentences.This gives rise to the task of Chinese Word Segmentation (CWS) (Zhang et al., 2003;Peng et al., 2004;Huang and Zhao, 2007;Zhao et al., 2006;Zheng et al., 2013;Zhou et al., 2017;Yang et al., 2017Yang et al., , 2018)).In the context of deep learning, the segmented words are usually treated as the basic units for operations (we call these models the word-based models for the rest of this paper).Each segmented word is associated with a fixed-length vector representation, which will be processed by deep learning models in the same way as how English words are processed.Word-based models come with a few fundamental disadvantages, as will be discussed below.Firstly, word data sparsity inevitably leads to overfitting and the ubiquity of OOV words limits the model's learning capacity.Particularly, Zipf's law applies to most languages including Chinese.Frequencies of many Chinese words are extremely small, making the model impossible to fully learn their semantics.Let us take the widely used Chinese Treebank dataset (CTB) as an example (Xia, 2000).Using Jieba, 3 the most widely-used opensourced Chinese word segmentation system, to segment the CTB, we end up with a dataset consisting of 615,194 words with 50,266 distinct words.Among the 50,266 distinct words, 24,458 words appear only once, amounting to 48.7% of the total vocabulary, yet they only take up 4.0% of the entire corpus.If we increase the frequency bar to 4, we get 38,889 words appearing less or equal to 4 times, which contribute to 77.4% of the total vocabulary but only 10.1% of the entire corpus.Statistics are given in Table 1.This shows that the word-based data is very sparse.The data sparsity issue is likely to induce overfitting, since more words means a larger number of parameters.In addition, since it    (Chen et al., 2017c).
is unrealistic to maintain a huge word-vector table, many words are treated as OOVs, which may further constrain the model's learning capability.
Secondly, the state-of-the-art word segmentation performance is far from perfect, the errors of which would bias downstream NLP tasks.Particularly, CWS is a relatively hard and complicated task, primarily because word boundary of Chinese words is usually quite vague.As discussed in Chen et al. (2017c), different linguistic perspectives have different criteria for CWS (Chen et al., 2017c).As shown in Table 1, in the two most widely adopted CWS datasets PKU (Yu et al., 2001) and CTB (Xia, 2000), the same sentence is segmented differently.
Thirdly, if we ask the fundamental problem of how much benefit word segmentation may provide, it is all about how much additional semantic information is present in a labeled CWS dataset.After all, the fundamental difference between wordbased models and char-based models is whether teaching signals from the CWS labeled dataset are utilized.Unfortunately, the answer to this question remains unclear.For example. in machine translation we usually have millions of training examples.The labeled CWS dataset is relatively small (68k sentences for CTB and 21k for PKU), and the domain is relatively narrow.It is not clear that CWS dataset is sure to introduce a performance boost.
Before neural network models became popular, there were discussions on whether CWS is necessary and how much improvement it can bring about.In information retrieval(IR), Foo and Li (2004) discussed CWS's effect on IR systems and revealed that segmentation approach has an effect on IR effectiveness as long as the SAME segmentation method is used for query and document, and that CWS does not always work better than models without segmentation.In cases where CWS does lead to better performance, the gap between word-based models and char-based models can be closed if bigrams of characters are used in charbased models.In the phrase-based machine translation, Xu et al. (2004) reported that CWS only showed non-significant improvements over models without word segmentation.Zhao et al. (2013) found that segmentation itself does not guarantee better MT performance and it is not key to MT improvement.For text classification, Liu et al. (2007) compared a naïve character bigram model with word-based models, and concluded that CWS is not necessary for text classification.Outside the literature of computational linguistics, there have been discussions in the field of cognitive science.Based on eye movement data, Tsai and McConkie (2003) found that fixations of Chinese readers do not land more frequently on the centers of Chinese words, suggesting that characters, rather than words, should be the basic units of Chinese reading comprehension.Consistent with this view, Bai et al. (2008) found that Chinese readers read unspaced text as fast as word spaced text.
In this paper, we ask the fundamental question of whether word segmentation is necessary for deep learning-based Chinese natural language processing.We first benchmark word-based models against char-based models (those do not involve Chinese word segmentation).We run apples-toapples comparison between these two types of models on four NLP tasks: language modeling, document classification, machine translation and sentence matching.We observe that char-based models consistently outperform word-based model.We also compare char-based models with wordchar hybrid models (Yin et al., 2016;Dong et al., 2016;Yu et al., 2017), and observe that char-based models perform better or at least as good as the hybrid model, indicating that char-based models already encode sufficient semantic information.
It is also crucial to understand the inadequacy of word-based models.To this end, we perform comprehensive analyses on the behavior of wordbased models and char-based models.We identify the major factor contributing to the disadvantage of word-based models, i.e., data sparsity, which in turn leads to overfitting, prevelance of OOV words, and weak domain transfer ability.
Instead of making a conclusive (and arrogant) argument that Chinese word segmentation is not necessary, we hope this paper could foster more discussions and explorations on the necessity of the long-existing task of CWS in the community, alongside with its underlying mechanisms.
Since the First International Chinese Word Segmentation Bakeoff in 2003 (Sproat and Emerson, 2003) , a lot of effort has been made on Chinese word segmentation.
Most of the models in the early years are based on a dictionary, which is pre-defined and thus independent of the Chinese text to be segmented.The simplest but remarkably robust model is the maximum matching model (Jurafsky and Martin, 2014).The simplest version of it is the left-to-right maximum matching model (maxmatch).Starting with the beginning of a string, maxmatch chooses the longest word in the dictionary that matches the current position, and advances to the end of the matched word in the string.Different models are proposed based on different segmentation criteria (Huang and Zhao, 2007).
With the rise of statistical machine learning methods, the task of CWS is formalized as a tagging task, i.e., assigning a BEMS label to each character of a string that indicates whether the character is the start of a word(Begin), the end of a word(End), inside a word (Middel) or a single word(Single).Traditional sequence labeling models such as HMM, MEMM and CRF are widely used (Lafferty et al., 2001;Peng et al., 2004;Zhao et al., 2006;Carpenter, 2006). .
Neural CWS Models such as RNNs, LSTMs (Hochreiter and Schmidhuber, 1997) and CNNs (Krizhevsky et al., 2012;Kim, 2014) not only provide a more flexible way to incorporate context semantics into tagging models but also relieve researchers from the massive work of feature engineering.Neural models for the CWS task have become very popular these years (Chen et al., 2015b,a;Cai and Zhao, 2016;Yao and Huang, 2016;Chen et al., 2017b;Zhang et al., 2016;Chen et al., 2017c;Yang et al., 2017;Cai et al., 2017;Zhang et al., 2017).Neural representations can be used either as a set of CRF features or as input to the decision layer.

Experimental Results
In this section, we evaluate the effect of word segmentation in deep learning-based Chinese NLP in four tasks, language modeling, machine translation, text classification and sentence matching/paraphrase. important hyper-parameters such as learning rate, batch size, dropout rate, etc.

Language Modeling
We evaluate the two types of models on Chinese Tree-Bank 6.0 (CTB6).We followed the standard protocol, by which the dataset was split into 80%, 10%, 10% for training, validation and test.The task is formalized as predicting the upcoming word given previous context representations.The text is segmented using Jieba. 4An upcoming word is predicted given the previous context representation.
For different settings, context representations are obtained using the char-based model and the wordbased model.LSTMs are used to encode characters and words.
Results are given in Table 3.In both settings, the char-based model significantly outperforms the word-based model.In addition to Jieba, we also used the Stanford CWS package (Monroe et al., 2014) and the LTP package (Che et al., 2010), which resulted in similar findings.
It is also interesting to see results from the hybrid model (Yin et al., 2016;Dong et al., 2016;Yu et al., 2017), which associates each word with a representation and each char with a representation.A word representation is obtained by combining the vector of its constituent word and vectors of the remaining characters.Since a Chinese word can contain an arbitrary number of characters, CNNs are applied to the combination of characters vectors (Kim et al., 2016) to keep the dimensionality of the output representation invariant.
We use hybrid (word+char) to denote the standard hybrid model that uses both char vectors and word vectors.For comparing purposes, we also implement a pseudo-hybrid model, denoted by hybrid (char only), in which we do use a word segmentor to segment the texts, but word representations are obtained only using embeddings of their constituent characters.We tune hyper-parameters such as vector dimensionality, learning rate and batch size for all models.
Results are given in Table 3.As can be seen, the char-based model not only outperforms the word-based model, but also the hybrid (word+char) model by a large margin.The hybrid (word+char) model outperforms the word-based model.This means that characters already encode all the semantic information needed and adding word embeddings would backfire.The hybrid (char only) model performs similarly to the char-based model, suggesting that word segmentation does not provide any additional information.It outperforms the word-based model, which can be explained by that the hybrid (char only) model computes word representations only based on characters, and thus do not suffer from the data sparsity issue, OOV issue and the overfitting issue of the word-based model.
In conclusion, for the language modeling task on CTB, word segmentation does not provide any additional performance boost, and including word embeddings worsen the result.

Machine Translation
In our experiments on machine translation, we use the standard Ch-En setting.The training set consists of 1.25M sentence pairs extracted from the LDC corpora. 5The validation set is from NIST 2002 and the models are evaluated on NIST 2003NIST , 2004NIST , 2005NIST , 2006NIST and 2008.We followed exactly the common setup in Ma et al. (2018); Chen et al. (2017a); Li et al. (2017); Zhang et al. (2018), which use top 30,000 English words and 27,500 Chinese words.For the char-based model, vocab size is set to 4,500.We report results in both the Ch-En and the En-Ch settings.
Regarding the implementation, we compare char-based models with word-based models under the standard framework of SEQ2SEQ +attention (Sutskever et al., 2014;Luong et al., 2015).The current state-of-the-art model is from Ma et al. (2018), which uses both the sentences (seq2seq) and the bag-of-words as targets in the training stage.We simply change the word-level encoding in Ma et al. (2018) to char-level encoding.For En-Ch translation, we use the same dataset to train and test both models.As in Ma et al. (2018), the dimensionality for word vectors and char vectors is set to 512. 6esults for Ch-En are shown in Table 4.As can be seen, for the vanilla SEQ2SEQ +attention model, the char-based model outperforms the word-based model across all datasets, yielding an average performance boost of +0.83.The same pattern applies to the bag-of-words framework in Ma et al. (2018).When changing the word-based model to the charbased model, we are able to obtain a performance boost of +0.63.As far as we are concerned, this is the best result on this 1.25M Ch-En dataset.
Results for En-Ch are presented in Table 5.As can be seen, the char-based model outperforms the word-based model by a huge margin (+3.13), and this margin is greater than the improvement in the Ch-En translation task.This is because in Ch-En translation, the difference between word-based and char-based models is only present in the source encoding stage, whereas in En-Ch translation it is present in both the source encoding and the target decoding stage.Another major reason that contributes to the inferior performance of the wordbased model is the UNK word at decoding time, We also implemented the BPE subword model (Sennrich et al., 2016b,a) on the Chinese target side.The BPE model achieves a performance of 41.44 for the Seq2Seq+attn setting and 44.35 for bag-ofwords, significantly outperforming the word-based model, but still underperforming the char-based model by about 0.8-0.9 in BLEU.
We conclude that for Chinese, generating characters has the advantage over generating words in deep learning decoding.

Sentence Matching/Paraphrase
There are two Chinese datasets similar to the Stanford Natural Language Inference (SNLI) Corpus (Bowman et al., 2015): BQ and LCQMC, in which we need to assign a label to a pair of sentences depending on whether they share similar meanings.For the BQ dataset (Chen et al., 2018), it contains 120,000 Chinese sentence pairs, and each pair is associated with a label indicating whether the two sentences are of equivalent semantic meanings.The dataset is deliberately constructed so that sentences in some pairs may have significant word overlap but complete different meanings, while oth-   ers are the other way around.For LCQMC (Liu et al., 2018), it aims at identifying whether two sentences have the same intention.This task is similar to but not exactly the same as the paraphrase detection task in BQ: two sentences can have different meanings but share the same intention.For example, the meanings of "My phone is lost" and "I need a new phone" are different, but their intentions are the same: buying a new phone.Each pair of sentences in the BQ and the LCQMC dataset is associated with a binary label indicating whether the two sentences share the same intention, and the task can be formalized as predicting this binary label.To predict correct labels, a model needs to handle the semantics of the subunits of a sentence, which makes the task very appropriate for examining the capability of semantic models.
We compare char-based models with word-based models.For the word-based models, texts are segmented using Jieba.The SOTA results on these two datasets is achieved by the bilateral multiperspective matching model (BiMPM) (Wang et al., 2017).We use the standard settings proposed by BiMPM, i.e. 200d word/char embeddings, which are randomly initialized.
Results are shown in Table 6.As can be seen, the char-based model significantly outperforms the word-based model by a huge margin, +1.34 on the LCQMC dataset and +2.90 on the BQ set.For this paraphrase detection task, the model needs to handle the interactions between sub-units of a sentence.We conclude that the char-based model is significantly better in this respect.

Text Classification
For text classification, we use the currently widely used benchmarks including: • ChinaNews: Chinese news articles split into 7 news categories.• Ifeng: First paragraphs of Chinese news articles from 2006-2016.The dataset consists of 5 news categories; • JD Full: product reviews in Chinese crawled from JD.com.The reviews are used to predict customers' ratings (1 to 5 stars), making the task a five-class classification problem.• JD binary: the same product reviews from JD.com.We label 1, 2-star reviews as "negative reviews" and 4 and 5-star reviews as "positive reviews" (3-star reviews are ignored), making the task a binary-classification problem.• Dianping: Chinese restaurant reviews crawled from the online review website Dazhong Dianping (similar to Yelp).We collapse the 1, 2 and 3-star reviews to "negative reviews" and 4 and 5-star reviews to "positive reviews".The datasets were first introduced in Zhang and LeCun (2017).We trained the word-based version and the char-based version of bi-directional LSTM models to solve this task.Results are shown in Table 7.As can be seen, the only dataset that the char-based model underperforms the word-based   Jiang, 2008;Zhuang et al., 2010) refers to the ability of extending a model learned from one data distribution (the source domain) for a different (but related) data distribution (the target domain).Because of the data sparsity issue, we hypothesize that char-based models have greater domain adaptation ability than word-based models.We test our hypothesis on different sentiment analysis datasets.We train the word-based model and the char-based model on Dianping (2M restaurant reviews) and test the two models on jd binary (0.25M product reviews), as denoted by train dianping test jd.We also train models on jd binary and test them on Dianping, as denoted by train jd test dianping).Results are given in Table 8.As expected, the char-based model has more domain adaptation ability and performs better than the word-based model on both settings.The OOV issue is especially serious for the word-based model.In the train dianping test jd setting, 11.79% of the test sentences contain OOVs for the word-based model, whereas this number is only 0.56% for the char-based model.Similar observation holds for the train jd test dianping setting.

Analysis
In this section, we aim at understanding why wordbased models underperform char-based models.We acknowledge that it is impossible to thoroughly inspect the inner mechanism of word-based models, but we try our best to identify major factors explaining the inferiority of word-based models.

Data Sparsity
A common method to avoid vocabulary size getting too big is to set a frequency threshold, and use a special UNK token to denote all words whose frequency is below the threshold.The value of the frequency threshold is closely related to the vocabulary size, and consequently the number of parameters.Figure 2 shows the correlation between the vocabulary size and the frequency threshold, along with the correlation between model performances and the frequency threshold.For both the charbased model and the word-based model, using all words/chars (threshold set to 0) leads to bad results.The explanation is intuitive: it is hard to learn the semantics of infrequent words/characters.
For the char-based model, the best performance is obtained when character frequency threshold is set to 5, resulting in a vocabulary size of 1,432 and a medium character frequency of 72.For the word-based model, the best performance is obtained when word frequency threshold is set to 50, in which case the vocabulary size is 1,355 and the medium word frequency is 83.As can be seen, the vocabulary size and the medium word frequency for the best word-based model is similar to those of the best char-based model.This means, for a given  dataset, in order to learn the word/char semantics well, the model needs to have enough exposure to each word/character, the amount of which is approximately the same across different models.For the word-based model, this requirement is particularly hard to meet due to its sparseness.

Out-of-Vocabulary Words
One possible explanation for the inferiority of the word-based model is that it contains too many OOVs.If so, we should be able to narrow or even close the gap between word-based models and charbased models by decreasing the number of OOVs.As discussed in Section 4.2, setting the frequency threshold low to avoid OOVs will hinder the performance because it worsen the data sparsity issue.We thus use an alternative strategy: for different word-frequency thresholds, we remove sentences that contain word OOVs from all of the training, validation and test sets.Figure 4 shows vocabulary sizes of the training set and accuracies plotted against word frequency threshold.As can be seen, the gap between the two types of models is gradually narrowed as we increase the word-frequency threshold.It is also interesting that the curve for the char-based model goes up slightly at the beginning and then goes down steadily.It is because the OOV issue is not severe for the char-based model and thus does not affect the performance much.However, as we remove more and more training examples, the shrinking training dataset creates a bigger problem.By contrast, for the word-based model, the performance keeps increasing even when the frequency threshold is set to 50, meaning that the positive influence of removing some OOVs outweighs the negative influence of eliminating some training data.In conclusion, the word-based model suffers from the OOV issue.This issue can be alleviated by reducing the number of OOVs in the datasets.

Overfitting
The data sparsity issue leads to the fact that wordbased models have more parameters to learn, and thus are more prone to overfitting.We conducted experiments on the BQ dataset (Chen et al., 2018) and the results validate this point (Figure 1).To achieve the best results, a larger dropout rate is needed for the word-based model (0.5) than the char-based model (0.3).This means overfitting is a severe issue for the word-based model.We also observe that curves with different dropout rates are closer together in word-based models than in charbased models, which means the dropout technique is not enough to resolve the overfitting issue.the char-based model without dropout already achieves better performance (80.82) than the word-based model with the optimal dropout rate (80.65).

Visualization
The BQ semantic matching task aims at deciding whether two sentences have the same intention.Figure 3 tangibly shows why the char-based model outperforms the word-based model.The heatmap denotes the attention matching values between tokens of two two sentences, computed by the BiPMP model (Wang et al., 2017).The input two sentences are: (1) 利息费用是多少 (how much is the interest expense), with segmented text being 利息费 用 (interest expense) 是 (is) 多少 (how much) and ( 2) 下一个月还款要扣多少利息 (how much interest do I have to pay if I repay the bill next month), with segmented text being 下个月(next month) 还款 (repay), 扣 (hold) 多少 (how much) 利息 (interest).For word-based semantic matching, since 利息费用(interest expense) is treated as a single word, it fails to be mapped to 利息(interest).This is not the case with the char-based model since the same character in the two sentences are more easily mapped.

Conclusion
In this paper, we ask the fundamental question of whether word segmentation is necessary for deep learning of Chinese representations.We benchmark such word-based models against char-based models in four end-to-end NLP tasks, and enforce apples-to-apples comparisons as much as possible.We observe that char-based models consistently outperform word-based models.Building upon these findings, we show that word-based models' inferiority is due to the sparseness of word distributions, which leads to more out-of-vocabulary words, overfitting and lack of domain generalization ability.We hope this paper will foster more discussions on the necessity of the long-existing task of CWS in the community.

Figure 1 :
Figure 1: Effects of dropout rates on the char-based model and the word-based model.

Figure 2 :Figure 3 :
Figure 2: Effects of data sparsity on the char-based model and the word-based model.

Figure 4 :
Figure 4: Effects of removing training instances containing OOV words.

Table 1 :
Word statistics of Chinese TreeBank.

Table 2 :
CTB and PKU have different segmentation criteria

Table 3 :
To enforce apples-to-apples comparison, for both the word-based model and the char-based model, we use grid search to tune all Language modeling perplexities in different models.

Table 5 :
Results on the En-Ch machine translation task.

Table 6 :
Results on the LCQMC and BQ corpus.

Table 7 :
Results on the validation and the test set for text classification.

Table 8 :
Domain adaptation of the word-based model and the char-based model model is the chinanews dataset, but the difference is quite small (0.05).On all the other datasets, the char-based model significantly outperforms the word-based model.