Chinese Word Embeddings

July 28, 2020 · View on GitHub

Background

Word embedding ingests a large corpus of text and outputs, for each word type, an n-dimensional vector of real numbers. This vector captures syntactic and semantic information about the word that can be employed to solve various NLP tasks. In Chinese, the unit of encoding may be a character or a sub-character unit, rather than a word.

Example

Input:

Large corpus of text

Output:

“查询”, vec(W) = [-0.059569, 0.126913, 0.273161, 0.225467, -0.185914, 0.018743, -0.18434, 0.083859, -0.115781, -0.216993, 0.063437, -0.005511, 0.276968,…, 0.254486]

Standard Metrics

Word vectors can be evaluated intrinsically (e.g., whether similar words get similar vectors) or extrinsically (e.g., to what extent word vectors can improve a sentiment analyzer).

Intrinsic evaluation looks at

  • Word relatedness : Spearman correlation (⍴) between human-labeled scores and scores generated by the embeddings on Chinese word similarity datasets wordsim-240 and wordsim-296 (translations of English resources).
  • Word Analogy: Accuracy on the word analogy task (e.g: “ 男人 (man) : 女人 (woman) :: 父亲 (father) : X ”, where X chosen by cosine similarity). Different types of word analogy tasks (1) Capitals of countries (2) States/provinces of cities (3) Family words

Extrinsic evaluation:

  • Accuracy on Chinese sentiment analysis task
  • F1 score on Chinese named entity recognition task
  • Accuracy on part-of-speech tagging task

See e.g. Torregrossa et al., 2020 for a more detailed comparison of metrics

Chinese word similarity lists.

Test set# word pairs with human similarity judgments
wordsim-240240
wordsim-296297

Metrics

Results

  • The SoTA system (VCWE) published in NAACL 2019, combines intra-character compositionality (computed via convolutional neural network ) and inter-character compositionality (computed via a recurrent neural network with self-attention) to compute the word embeddings
Systemwordsim-240 (⍴)wordsim-296 (⍴)
Sun et. al. (2019) (VCWE)57.8161.29
Yu et. al. (2017) (JWE)51.9259.84

Chinese word analogy lists.

Given “France : Paris :: China : ?”, a system should come up with the answer “Beijing”.

Test set# analogies
Capitals of countries687
States/provinces of cities175
Family relationships240

Metrics

Results

SystemAccuracy (capital)Accuracy (state)Accuracy (family)Accuracy (total)
Yu et. al. (2017) (JWE)0.910.930.620.85
Yin et. al. (2016) (MGE)0.890.880.390.76
CBOW (baseline)0.840.880.600.79

Chinese sentiment analysis.

  • This test measures how much the sentiment analysis task benefits from different word vectors.
  • There is no agreed-upon baseline (e.g., sentiment classifier code), so it is difficult to compare across papers.
  • Sentiment dataset available at http://sentic.net/chinese-review-datasets.zip (Peng et. al. (2018))
    • Consists of Chinese reviews in 4 domains: notebook, car, camera and phone
    • Binary classification task: reviews are either positive or negative
    • Does not have train/dev/test split.
Test set# positive reviews# negative reviews
Notebook417206
Car886286
Camera1,558673
Phone1,713843

Results

SystemAccuracy (notebook)Accuracy (car)Accuracy (camera)Accuracy (phone)Accuracy (overall)
Sun et. al. (2019) (VCWE)80.9585.5983.9384.3888.92
Yu et. al. (2017) (JWE)77.7878.8181.7081.6485.13
Baseline (skip-gram)69.8477.1280.8081.2586.65

Chinese name tagging.

  • This test measures how much the name tagging task benefits from different word vectors.
  • There is no agreed-upon baseline (e.g., name tagging code), so it is difficult to compare across papers.
  • This evaluation evaluates entity taggers on three types of entities: Person (PER), Location (LOC), and Organization (ORG): Levow (2006)
Test setSize (words)Genre
SIGHAN 2006 NER MSRA100,000Newswire, Broadcast News, Weblog

Results

SystemF1 score
Sun et. al. (2019) (VCWE)85.77
Yu et. al. (2017) (JWE)85.30

Resources

Train setSize (words)Genre
SIGHAN 2006 NER MSRA1.3MNewswire, Broadcast News, Weblog

Other Resources

Various Word embeddings

NameAdditional featuresTraining Corpus SizeSource
FastText-374M charactersGrave et al., 2018
MimickInterpolate between similar characters to improve rare words, multilingualPinter et al., 2017
Glyph2vecUses character bitmaps, canjie to address OOV problem10M charsChen et al., 2020

Text corpora

CorpusSize (words)Size (vocabulary)Genre
Wikipedia dump153,278,00066,856General
People’s Daily31,000,000105,000News

Suggestions? Changes? Please send email to chinesenlp.xyz@gmail.com