PACLIC 34 · 2020 · Interactive explainer

Naming the writer of a Vietnamese text from its word habits

Everyone repeats small habits when they write: favourite short words, a typical word length, a certain range of vocabulary. Few studies had checked whether those habits identify writers in Vietnamese. This paper collected 1,304 opinion texts by ten writers and tested three classic counting methods on them.

Which of ten writers produced this text?

Pick a held-out text. The method measures how far its word counts are from each writer’s known texts; the shortest bar is its answer.

Held-out text of Author126289,997 words · hidden from the method

The method is Kilgarriff’s chi-squared on the 500 most frequent words. For every one of the ten held-out texts, the shortest bar belongs to the true author. Source: Table 3. Author names are anonymised IDs in the paper.

1,304opinion texts from online newspapers, Facebook and blogs
10writers, each a candidate for every test text
1,129,288tokens in the corpus, punctuation included
58,088words per writer used as the “known” sample
100%writers identified by chi-squared (10 of 10)
1 · The gap

Counting words to find a writer goes back to 1851, but was new for Vietnamese

measures writing style with numbers. Its oldest job is : given a text and a list of possible writers, decide who wrote it. The same tools are used to detect plagiarism, check a disputed signature on a document, or guess a writer’s age or region.

Think of it asA handwriting expert who never reads the letter’s meaning, only how the pen moves. Here the “pen movements” are word lengths and how often small words such as là, và, của appear.

The methods were developed and tested mostly on English and other languages with large resources. The authors note that very few studies apply them to Vietnamese, partly because there was no corpus with enough text per known writer.

Where do the three methods come from?

Tap a date. The history is the one the paper gives in its introduction.

Word length (Mendenhall) and word frequency (Zipf, Mosteller and Wallace) are the two families of clues this paper tests.

2 · Building it

Ten opinion writers, about a million words

The holds 1,304 texts in which ten writers give their opinion or share experiences on social issues. Most come from VnExpress, a Vietnamese online newspaper; the rest from Facebook and blogs. Links, images and captions were removed.

Vietnamese writes a space between every syllable, so a single word such as xã hội (“society”) spans two space-separated pieces. The text was split into words () semi-automatically with the CLC toolkit, then the whole corpus was checked by hand.

Each writer’s text was split in two. A known sample of exactly 58,088 words (punctuation removed) acts as the writer’s profile. The rest is a held-out test text: the “mystery” document the methods must attribute.

How much text does each writer contribute?

Each bar is one writer. Tap a writer for their numbers.

Known sample (58,088 words) Held-out test text Punctuation tokens

The known samples are equal by design, so no writer has an advantage from writing more. The test texts are not: Author1262’s is 89,997 words, Author83’s only 14,525. Source: Table 1 (known = corpus words without punctuation − test-set words).

For researchers: Table 1 in full
3 · Clue one: word length

Do writers prefer longer or shorter words?

In 1887 Thomas Mendenhall proposed that a writer’s “stylistic signature” shows in how often they use words of each length. Count the characters of every word, tally the lengths, and draw the tally as a curve: the characteristic curve.

Before looking at the writers, try it on the most common Vietnamese words in this corpus.

How long is a common Vietnamese word?

These are the 30 most frequent words in the writers’ known samples, listed in the paper. Tap one to count its letters. computed here

Among these 30 words, 3-letter words such as của, một, tôi are the largest group. The letter counts are computed on this page from the paper’s word list; diacritics do not add letters.

The authors drew one curve per writer from the full 58,088-word known samples. They report that every writer uses words of 2 to 4 characters most, with 3 characters at the top.

What do the ten characteristic curves look like?

One line per writer: how many of their 58,088 words have each length. Pick a writer to highlight. traced, approximate

Selected writer The other nine

All ten curves rise to a sharp peak at 3 characters and fall away almost together. Author1262 has the tallest peak and, with Author1035, a higher point at 4 than at 2. The paper shows these curves only as plots (Figure 5, where each panel’s x-axis is sorted by frequency); we traced them and redrew them on one shared length axis. Values are approximate: each traced curve adds up to within about 1% of 58,088.

The curves overlap so closely that the differences are easier to see as a ranking: which length comes first, second and third for each writer.

Which word lengths does each writer use most?

Each row lists word lengths from most to least used, as ordered on the x-axis of the paper’s curves. Tap a writer.

3 characters 2 characters 4 characters

Eight writers go 3 → 2 → 4. Author1035 and Author1262 go 3 → 4 → 2. Otherwise the orders are very similar. The paper uses these curves to describe style; it does not use them to attribute the test texts. Source: Figure 5 (order of the x-axis labels; the counts themselves are not given as numbers).

For researchers: how Figure 5 was read

The paper’s Figure 5 is ten NLTK frequency plots whose x-axis is sorted by count, not by length. This figure reproduces only that order. One panel is printed as “Author108”, a name not in Table 1; the author confirmed (2026-11-10) that it is Author203, and it is labelled Author203 here. One detail still differs from the text: the Author203 and Author1050 panels list a length of 15, while the text says the longest words of these two writers have 14 characters. The text also reports that Author59’s longest word has 17 characters. In the Author97 panel the 2- and 4-character counts are nearly equal.

How varied is each writer’s vocabulary?

Alongside the curves, the authors measured with Carroll’s index R: the number of different words () divided by the number of words. Because every known sample has the same 58,088 words, R simply tracks vocabulary size.

Whose vocabulary is richest?

R = different words ÷ 58,088. Higher means more varied. Tap a writer to see the division.

Author1035 has the richest vocabulary (R = 0.146, 8,456 different words); Author83 the narrowest (R = 0.092, 5,327). Our running example, Author1262, sits near the top with 0.129. Source: Table 2.

4 · Clue two: frequent words

Chi-squared asks: could these two texts come from the same writer?

The second method, Kilgarriff’s , looks at the 500 most frequent words. It pools a writer’s known sample with the mystery text and asks: if both were random samples of the same writer, how often should each word appear in each? Then it adds up how far the real counts are from those expectations.

Think of it asPouring two bags of marbles together. If both bags came from the same factory, each colour should split between them in proportion to the bags’ sizes. A big mismatch says “different factories”.

How does chi-squared turn word counts into one distance? illustrative numbers

A toy example with two words instead of 500. Step through it.

The counts here are made up to show the arithmetic. The real test used the 500 most frequent words, a 58,088-word known sample and the full held-out text; everything was lowercased first.

For researchers: the formulas

For candidate file Ki and unknown file U, with joint corpus J and AuShare = len(Ki) / len(J):

χ² = χ²(Ki) + χ²(U), χ²(Ki) = Σₓ (Kcw_ob − Kcw_ex)² / Kcw_ex, χ²(U) = Σₓ (Ucw_ob − Ucw_ex)² / Ucw_ex

x runs over the 500 most common words of J. Expected counts split each word’s joint count by AuShare and 1 − AuShare. The smallest χ² over the ten candidates gives the attribution.

Run this for every pair of known writer and held-out text and you get a 10 × 10 table of distances. If the method works, each column’s smallest value should sit on the diagonal, where the writer meets their own text.

Does each text land closest to its own writer?

Columns are held-out texts, rows are known writers. Darker = closer. Tap a column header to focus it.

Column minimum, correct writer Diagonal (true writer)

Yes, in all ten columns: chi-squared attributes 100% of the test texts correctly. Source: Table 3.

For researchers: reading Table 3

Table 3 labels both axes “Authors”. We read columns as tested texts, as the paper states for Tables 4 and 5. For Table 3 the orientation does not change the result: each diagonal value is the minimum of its row and of its column.

5 · Clue three: a few very common words

Burrows’ Delta uses only the 20 or 30 most common words

John Burrows’ takes a narrower view. It keeps the n most frequent words of all known samples combined (the paper tried n = 20 and n = 30), and for each writer turns the frequency of every word into a : how far above or below the group average that writer is. Delta is the average gap between the mystery text’s z-scores and a writer’s z-scores. Smaller is closer.

Think of it asComparing people by a short checklist of habits (“uses tôi more than average”, “uses thì less than average”) and picking the closest match.

With 20 or 30 signature words, who gets matched to whom?

Switch the number of words. Columns are held-out texts; the outlined cell is the writer Delta picks.

Pick = true writer Pick = someone else Diagonal (true writer)

Many picks fall off the diagonal. With 20 words Delta is right for 5 of 10 texts; adding 10 more words drops it to 4 of 10. Source: Tables 4 and 5; outlines follow the paper’s highlighted cells.

For researchers: Delta, step by step
Zi = (Ci − μi) / σi Δc = Σi |Zc(i) − Zt(i)| / n

Ci is the observed frequency of feature word i; μi and σi are its mean and standard deviation across the ten known sub-corpora; Zt is the test text’s z-score. In Table 5, three columns tie at three decimals (texts of Author88, Author97 and Author1262); we follow the paper’s highlighted cell, which counts Author1262 as a hit and Author97 as a miss.

6 · Results

Chi-squared names every writer; Delta gets half or fewer

Picking a writer at random would be right 1 time in 10. All three results clear that bar, but only chi-squared gets every text right; the authors note that Delta did not do as well as they expected.

How many of the ten test texts does each method attribute correctly?

Each square is one writer’s held-out text: red = right writer, orange = wrong. Higher is better.

Correct Wrong writer Random guess (1 in 10)

100% for chi-squared, 50% for Delta with 20 words, 40% with 30. Only Author1262 and Author1289 are right under all three. Source: Section 3.3 and 4.1.

How far off are the misses?

A wrong pick can be a near miss or a long way off. Ranking all ten candidates for each text shows where the true writer ended up.

Where does the true writer rank among the ten candidates?

1 = the method’s first choice. Tap a square for the distances behind it.

Ranked 1st Tied for 1st at three decimals Ranked lower

Delta’s misses are not all near misses: with 30 words, Author1035’s own profile is only 7th closest to Author1035’s text. Ranks computed on this page from Tables 3–5.

7 · Where it’s hard

Why did Delta stumble?

The authors point to the texts themselves. The VnExpress pieces come from the “Perspective” section, which covers finance, society, lifestyle, health and more, and not every writer covers the same topics. With only 20 or 30 very common words, a few topic-driven differences can push a text toward the wrong writer. Equal-sized known samples do not remove this topic imbalance.

Chi-squared has its own weak spots. It is a coarse measure: the most frequent words carry most of the weight, so subtle habits with rarer words go unnoticed. Lowercasing everything usually helps, by counting a sentence-initial word with its lowercase form, but can merge a proper noun with a common noun spelled the same way.

What we learned

Four takeaways

  1. Simple word counts can identify Vietnamese writers. Kilgarriff’s chi-squared over the 500 most frequent words attributed all 10 held-out texts to the right writer.
  2. A short list of common words is not enough. Burrows’ Delta reached 50% with 20 words and 40% with 30, so adding words did not help here.
  3. Word-length curves look alike. All ten writers use 3-character words most; only Author1035 and Author1262 put 4-character words second.
  4. Vocabulary richness differs between writers. On equal 58,088-word samples, Carroll’s R ranges from 0.092 (Author83) to 0.146 (Author1035).

Next, the authors plan a corpus with a wider variety of topics and a richer annotated corpus for machine-learning approaches to authorship.

Setup, data and limitations
Setup
Data provenance
Limitations and notes
Paper (ACL Anthology)aclanthology.org/2020.paclic-1.51 PDFaclanthology.org/2020.paclic-1.51.pdf
Lam Ho, Nhu Vo, Dien Dinh, & Nhung Nguyen. (2020). Identifying Authors Based on Stylometric Measures of Vietnamese Texts. Proceedings of the 34th Pacific Asia Conference on Language, Information and Computation (PACLIC), 447–452. https://aclanthology.org/2020.paclic-1.51.

Read next

NICS 2020Counting the words that set Vietnamese stories apart from other texts12 min readFAIR 2020Picking 100 million words that stand for Vietnamese14 min read

All publications · Get in touch about this research