Elamur Research

Microblog language identification: overcoming the limitations of short, unedited and idiomatic text

Paper · 2012 · S. Carter, Wouter Weerkamp and Manos Tsagkias

Summary

A tweet can be too short to tell which language it is written in. Familiar words may occur in several languages, a name can take up much of the text, and informal spellings can obscure patterns that are easy to recognize in edited writing. Simon Carter, Wouter Weerkamp and Manos Tsagkias investigate what a language identifier can learn from the material around a post. Their aim is to make it easier to select posts in a given language for analysis without relying completely on the words in each message.

The authors start with TextCat, which compares recurring character sequences in a post with the sequences common in each candidate language. Training it on Twitter posts improves overall test accuracy from 89.5% to 92.4% across Dutch, English, French, German and Spanish. The authors then use the same kind of classification to score other material: earlier posts by the author, pages the post links to, earlier posts by people it mentions, earlier posts with the same hashtag, and the preceding message when the post is a reply. Each source produces scores across the candidate languages. The authors call these contextual scores priors because they offer evidence about a post's language even when its own wording is hard to classify.

The author's posting history is the strongest individual addition, bringing overall test accuracy to 96.8% when combined with the tweet's own text. Combining several sources with weights chosen on development data reaches 97.2%. The best overall result, 97.4%, comes from allowing the weights to vary from post to post according to how clearly each source favors a language. With TextCat's supplied language profiles, which require no training of new profiles on tweets, the same confidence-based approach reaches 95.9%. The advantage of changing weights by post is modest compared with the gain from using the surrounding evidence in the first place.

The authors also apply their approach to 1.1 million tweets collected in a day. They examine which languages the classifier assigns, how those assignments vary by hour, and how often posts in the most often assigned languages contain links, hashtags or mentions. The interface language and the classified language give substantially different totals for some languages, and geographic metadata is available for few posts. The labeled test set and the large collection answer different questions. The test set measures accuracy against human judgments, while the large collection shows what patterns emerge when the classifier is applied at scale. Some of the remaining test errors, particularly in multilingual tweets, also show how much a single language label can leave out.

Deep dive: Microblog language identification: overcoming the limitations of short, unedited and idiomatic text

Carter and colleagues test how author histories, links, mentions, hashtags and replies help identify the language of short Twitter posts. · about 35 minutes to read

The problem and its context

What a language label is for

The authors approach language identification as a practical step in studying microblogs. Twitter supplies short public observations that researchers can use to follow events, examine opinion, or search for material about a subject. A collection assembled for any of those purposes can contain posts in several languages. If the intended analysis depends on knowing the language of the text, identifying it becomes part of selecting the material. A filtering error can leave relevant posts out of the collection or admit posts that the rest of the analysis is poorly equipped to handle.

At the level of a single tweet, the task is to assign a language to a document that may contain little ordinary prose. A post can include an account name, a link and a topical tag alongside a short fragment. Space constraints can encourage abbreviations and unconventional spellings. Writers may also use more than one language in the same message. Each of these phenomena affects what the identifier can learn from the text. There may be fewer usable character patterns, the patterns may differ from those learned from edited writing, or there may be good evidence for competing labels.

This is a form of text classification. The difficulty lies in what counts as adequate evidence for the category. A longer document can contain many words whose spellings and surrounding character sequences point in the same direction. In a tweet, a single shared word or a foreign-language name can account for a large part of the observable text. Even a classifier that ranks languages well for long documents can face a close decision here. If the message itself gives too little evidence, training it to recognize typical tweet spellings can help only when the message contains patterns worth recognizing.

Microblogs also expose material that can bear on the decision. A reply points to a preceding message. A mention identifies an account with a posting history. A link can lead to a document with much more text. This changes the unit of evidence available to the classifier. The object being labeled is still the individual tweet, but the classifier can inspect other documents related to it. The research question is whether those relationships carry language information often enough to improve decisions, and how the system should combine them when they disagree.

How earlier systems identified languages

The paper places its approach in a tradition of comparing character patterns. A character n-gram is a sequence of adjacent characters, with the value of n giving the sequence length. A profile built from a document ranks these sequences by frequency. A language profile ranks sequences observed in training text for that language. Comparing the rankings lets a classifier use recurring pieces of written words, including pieces that occur in many different words. The approach described by Cavnar and Trenkle assigns a document to the language whose profile has the smallest distance from the document's profile. The distance is based on how far sequences are displaced in the rankings. Their Usenet experiment, as reported by Carter and colleagues, reached 99.8% accuracy.

The earlier work reviewed in the paper also gives reasons to expect accuracy to change with the input. In the web-page study the authors discuss, accuracy ranged from 80 to 99% depending on the language. That range matters because even within a broad category such as web text, recognition may be easier for some languages than for others. A single overall rate would give little guidance about which individual labels need additional evidence.

Baldwin and Lui examined the effect of document length using Wikipedia pages. The figures cited in the paper are 90% accuracy for longer documents and 60–70% for shorter ones. A short document offers fewer occurrences from which to build a ranking, so this earlier result gives a reason to treat the amount of text as an experimental variable. Gottron and Lipka, however, obtained 99.4% accuracy using 5-grams on news headlines that averaged 45.1 characters. Their result suggests that the origin and style of a short text matter alongside its size. Headlines can be brief while still retaining recognizable spelling and word forms.

Carter and colleagues therefore pose the problem in terms of length and the kind of writing found on Twitter. They make a comparison with short formal sentences so that the contrast with tweets is about more than full documents versus fragments. They also separate the effect of training on tweets from the effect of adding related material. The first change affects what the classifier recognizes in the target text. The second gives it more to inspect. Keeping these changes distinct lets the experiments show whether outside evidence remains useful after the classifier has learned the writing conventions of the target platform.

The method, step by step

Score the tweet against each language

TextCat builds a ranked character profile of the input and compares it with the profile of each candidate language. The authors use the top 400 n-grams for profiling, the usual setting in their implementation and the best choice in their preliminary experiments. They start with two sets of reference profiles. One is supplied with TextCat. The other is trained on labeled tweets. In either case the classifier produces a distance for each candidate, so a tweet can have several plausible languages even though the final decision assigns only one.

The paper writes the output for a post as a vector. Each position refers to the same language whenever two vectors are compared or combined. This shared ordering is what makes it possible to add evidence from documents as different as a linked article and a short reply.

λ⃗ₚ = ⟨λₚ¹, λₚ², …, λₚᶻ⟩

Here p is the post, λ⃗ₚ is its full vector of distances, and λₚⁱ is the distance for the candidate at position i in the language inventory. The symbol z is the number of candidate languages. Angle brackets enclose the ordered entries, and the ellipsis stands for the intervening language positions. Smaller raw distances indicate closer matches. The authors denote the vector obtained from the tweet itself by adding C, for content, to the vector notation.

The classifier keeps the whole vector for a reason. A result in which the nearest language is well ahead of its competitors offers a different basis for action from a result in which several candidates are almost tied. Either result can be reduced to a winning label, but doing so discards the information the authors later use to estimate confidence. The vectors also let related texts contribute partial support for several languages.

From a tweet and its context to a language decision

The steps in order.

From a tweet and its context to a language decisionStep 1: Compare the tweet with candidate language profiles1. Compare the tweet with candidate language profilesStep 2: Find available histories, links, tags and replies2. Find available histories, links, tags and repliesStep 3: Score the related texts against those candidates3. Score the related texts against those candidatesStep 4: Standardize scores before averaging or interpolation4. Standardize scores before averaging or interpolationStep 5: Assign votes or weights to the available evidence5. Assign votes or weights to the available evidenceStep 6: Choose a language for the tweet6. Choose a language for the tweet

The paper calls the contextual sources semisupervised priors. The initial identifier is supervised because its language profiles derive from text with known language labels. The contextual material can be unlabeled. An author history, for example, can be scored without asking a person to identify the language of each earlier message. Those automatic scores then stand as evidence for the tweet being classified. In this use, a prior is a source of language evidence available independently of the target tweet's text. The term does not imply that the vector is a probability distribution.

For a link, the method retrieves the linked page and classifies its content using the profiles supplied with TextCat. A linked page can supply a longer stretch of text than the tweet. When a tweet links to several pages, the method averages their vectors position by position. Each language receives the mean of its scores across those pages.

Lλ⃗ₚ = (1/k) ∑ᵏᵢ₌₁ Cλ⃗ₗᵢ

Lλ⃗ₚ is the link vector for post p. The symbol k is the number of links used, i indexes them, and lᵢ is the page reached from link i. Cλ⃗ₗᵢ is the vector obtained from that page's content. The summation sign instructs the classifier to add corresponding language entries across the pages. Multiplication by 1/k takes their mean. A strong match to a language on the linked page helps the tweet only to the extent that the two texts use the same language.

The blogger prior uses earlier tweets from the person who wrote the target post. The authors score those tweets with the profiles trained on the platform in the main setup. Each earlier post supplies a vector, and the mean of the vectors represents the author's posting history. An author who generally writes in the same language can supply a useful signal when the current tweet has few words.

Bλ⃗ₚ = (1/k) ∑ᵏᵢ₌₁ Cλ⃗ₚᵢ

Bλ⃗ₚ is the blogger vector for target post p. Here k counts the author's earlier posts used in the calculation, i identifies an earlier post, and pᵢ denotes that post. Cλ⃗ₚᵢ is its content vector. The sum runs across the history, and 1/k converts the sum to a mean. Because the entries combine evidence from many past posts, the result can be decisive even when a particular earlier post was difficult to score. It can also reflect a habitual choice that the author departs from in the target tweet.

The mention prior borrows the same procedure for the people identified by account mentions. An account name is useful here because it is a route to text produced by that person. When the post mentions several people, the method averages their blogger vectors. The averaging occurs over accounts at this stage. Within each account's vector, an earlier averaging step has already summarized its history.

Mλ⃗ₚ = (1/k) ∑ᵏᵢ₌₁ Bλ⃗ᵤᵢ

Mλ⃗ₚ is the mention vector for p. The symbol uᵢ denotes the account at position i among the k mentioned accounts used. Bλ⃗ᵤᵢ is the blogger vector built from that account's posting history. The sum collects those vectors, and 1/k gives each account an equal contribution to the mean. The premise is that language use by the people a post addresses or names can help describe the language of that interaction.

The conversation prior uses the preceding post when Twitter's reply metadata identifies one. The authors score that preceding post with the tweet-trained profiles in the main setup and use the resulting content vector directly. A mention can occur in many kinds of messages, whereas a reply record identifies a particular message that the writer is answering. The conversation prior therefore depends on continuity of language between those messages. Its evidence can still be sparse when the preceding message is itself very short.

The tag prior looks at other posts associated with the same hashtag. The authors describe the tag corpus as posts earlier than the one to be classified. The language evidence comes from the text of those posts, which lets the method use a tag even if its spelling is an unreliable clue. A tag that identifies a discussion concentrated in one language can produce a clear signal. If people use it across languages, its aggregate profile can become less informative or favor a different group from the one the current author belongs to.

Tλ⃗ₚ = (1/k) ∑ᵏᵢ₌₁ Cλ⃗ₜᵢ

Tλ⃗ₚ is the tag vector for target post p. Here k is the number of posts used from the tag corpus, i runs over those posts, tᵢ is the post at index i, and Cλ⃗ₜᵢ is its content vector. As in the link and blogger formulas, each candidate language has its own sum, which is divided by k to obtain its mean.

TextCat's raw scores are unnormalized. A score from a terse tweet and a score from a longer page can differ in scale, which matters whenever their values are averaged. The paper uses z-scores for the priors that involve averaging. Standardization expresses a value relative to the center and spread of the scores. The conversation prior directly reuses the preceding post's vector, so it has no internal averaging stage. The interpolation procedures also standardize scores for the combination across sources. Standardized values remain comparative scores, and the paper gives no probability calibration for them.

Combine the sources with a rule shared by all posts

The fixed-weight approach assigns each source a weight and applies the same weights to every post. It multiplies the standardized vector by its weight and adds the resulting vectors language by language. This retains information from the entire set of scores. A source can strengthen support for a language even if that language lies below its first choice.

lang(p) = arg max over i [∑ over q w_q · (qλ⃗ₚ)ᵢ]

Here lang(p) is the language assigned to target post p. The index i ranges over candidate languages, and q ranges over the link L, blogger B, mention M, content C, conversation V and tag T vectors. The expression (qλ⃗ₚ)ᵢ means the standardized score for language i from source q, and w_q is the weight for that source. The dot denotes multiplication. The sum adds the weighted terms, and arg max selects the language index with the highest combined score. The paper states the decision as a maximization, while defining the raw TextCat outputs as distances for which smaller values are preferable. Reading the maximization as a choice of the best combined evidence requires a score orientation consistent with that choice. Standardization alone does not establish the orientation, and the paper does not specify that conversion in the interpolation formula.

The weights are selected by sweeping across possible settings and retaining the one with the highest overall accuracy on development data. The paper also gives a separate sweep for tests that add one contextual source at a time to the content score. In those tests the weights of the two vectors are constrained to sum to 1. The learned setting expresses how useful a source was across the development posts. A weight chosen this way gives the same influence to a source each time the rule uses it, even when the available evidence varies in clarity.

The voting approach lets each source nominate its preferred language. The classification goes to the language with the most nominations. If the leading languages are tied, the authors use the highest normalized score across the priors to break the tie. Voting makes the decision less sensitive to the magnitude of individual scores. It also means that a source with a close internal contest casts a vote of the same strength as one whose favorite language is clearly ahead. The normalized scores come back into consideration only when the vote count calls for the tiebreaker.

Let the scores determine influence for each post

The post-dependent approach uses the shape of each vector to estimate how strongly that source favors its leading language. Picture a comparison in which a post's profile is close to one language profile and far from the others. Its distance ranking looks decisive. If the post is similarly close to several language profiles, the source shows less discrimination. The authors explore two ways to turn this observation into a weight. Beam confidence considers how many nearby competitors there are. Lead confidence concentrates on the gap between the best candidate and its closest rival.

In the verbal description of beam confidence, the authors start by ranking languages from their lowest raw distance to their highest. They describe a limit given by increasing the best distance by a beam expressed as a percentage, then stepping through the ranked candidates and stopping at the first one outside the limit. They write the limit in the following form.

limit(p) = d(k¹) + b

The symbol p is the post for which the prior supplies a distance ranking, d denotes raw distance, and k¹ is the candidate in the first position of that ranking. The beam is b. The plus sign denotes the increase, which the prose describes as a percentage of the distance. The resulting limit is the distance cutoff in that description.

The paper also writes a count of other candidates within the beam. Its equations for the count and membership use the following notation.

LIB(p) = ∑ᵏᵢ₌₂ inBeam(kⁱ)

LIB(p) is the count computed for the ordered distances of the prior under consideration for p. In this formula k is the number of ranked languages, i is a rank, and kⁱ denotes the language at rank i. The sum begins at 2 because the leading language is the starting point for the comparison. The term inBeam(kⁱ) indicates membership for the candidate at that rank.

inBeam(kⁱ) = 1 if d(kⁱ) < d(kⁱ⁻¹) + b, and 0 otherwise

The function inBeam returns 1 when its distance inequality is satisfied and 0 in the other case. The expressions d(kⁱ) and d(kⁱ⁻¹) are the raw distances at rank i and the immediately preceding rank. The symbol b again denotes the beam, and the less-than sign makes the test strict. This expression compares neighbors in the ranking. The prose uses the best candidate as the reference for the cutoff and describes stopping after a failed comparison. The displayed sum does not explicitly encode that stopping rule. These details can matter when several small gaps separate candidates whose total distance from the leader is larger than the beam.

After counting competitors, the authors try a linear and an exponential mapping from the count to a weight. Both make the weight smaller as the beam contains more candidates.

weight(p) = (|k| − LIB(p)) / (|k| − 1)

Here weight(p) is the confidence weight for the prior on post p, |k| denotes the size of the candidate inventory, and LIB(p) is the beam count. The subtraction in the numerator reduces the value as the count grows. The denominator, |k| − 1, is fixed for that inventory. The slash denotes division.

weight(p) = e^(−LIB(p) + 1)

Here weight(p) and LIB(p) have the same roles as in the linear formula. The symbol e is the base of the exponential function. The expression in parentheses is its exponent. Increasing the beam count lowers the exponent, so successive competitors reduce confidence multiplicatively. The two mappings let the authors test whether penalizing additional competitors more sharply helps the final decision.

Lead confidence uses the first and second entries in the distance ranking. The paper writes the difference between their normalized scores as the weight.

weight(p) = d(k¹) − d(k²)

Here weight(p) is the weight of the source on post p. The symbols k¹ and k² identify the best and next-best candidate, respectively, and d in this formula denotes their normalized scores. The minus sign subtracts the second score from the first. The intended interpretation is that greater separation yields greater confidence. As with fixed interpolation, the sign depends on how the scores are oriented. If normalization preserves the ordering of raw distances, the subtraction in the displayed formula is nonpositive. The paper gives the intended behavior and the written expression without detailing how that orientation is handled.

The post-dependent rules derive a weight from each source's own vector for the current tweet. They can give a clear-looking author history considerable weight on one decision and give it less influence on another. A sharply concentrated prior still can be wrong. The scores reveal how strongly the source favors a candidate, while the relationship between that source and the target tweet determines how well that preference transfers.

Prepare the training and development material

The authors start from tweets located through geographic selection, then manually select and label 1,000 tweets per language in the detailed dataset procedure. Of each language's examples, 400 train its TextCat profile, 100 are reserved for development and 500 are held out for testing. The development split is used to select interpolation weights and explore the beam settings. The test split measures the resulting choices. The paper reports releasing the training data and the trained TextCat profiles.

For the author prior, the authors retrieve as much posting history as they can, averaging 154.8 posts per user. They find 2,483 unique mentioned accounts and retrieve an average of 129.3 posts for each account in that mention collection. The hashtag procedure takes the 200 most recent posts containing the hashtag. The paper imposes no fixed time window on the extraction of these materials, although its definitions of the blogger and tag vectors describe posts that precede the target. The collection rules determine both the amount of supplementary text and the kinds of relationships the classifier can use.

Experiments and results

What counts as a correct decision

The labeled comparison covers Dutch, English, French, German and Spanish. All are evaluated within the same candidate inventory. The authors discard tweets that contain only material such as links and emoticons. When a tweet uses several languages, they assign the label of the language judged to convey the most substantive content. For such a tweet the evaluation asks whether the classifier recovers that judgment. It does not count how many of the languages present the system recognized.

Accuracy is the percentage of assigned labels that match the manual labels. The authors report accuracy within each language and across the test set. The test set includes 500 tweets per language. The overall result therefore describes the performance of a system on deliberately balanced labeled data. The separate scores reveal whether changes that improve that overall result help each language by a similar amount.

To compare overall accuracies the authors report a significance test, which they call the p test. They use thresholds of 90, 95 and 99% for the annotations beside some results. The statistic divides the difference in accuracies by a term that depends on the accuracies and the number of posts classified by both systems.

Z = (pₐ − pᵦ) / √(2p(1 − p)/n)

Z is the test statistic. The symbols pₐ and pᵦ denote the accuracies of the two systems expressed as proportions. In the denominator, p represents the average of those proportions, while n counts the tweets that both systems classified. The square-root sign applies to the full expression inside the parentheses. In this formula p is an accuracy quantity, and its role is different from p in the formulas for a post.

p = (pₐ + pᵦ) / 2

Here p is the mean accuracy used in the denominator of Z, pₐ and pᵦ are the same two accuracy proportions, and division by 2 gives them equal weight. The comparison concerns overall correctness for the tested systems. The reported significance annotations should be read with the comparison specified for each experiment, since the authors change the reference system as they progress from text alone to combination methods.

Short formal sentences and tweet text

The authors compare Twitter with shortened material from EuroParl to investigate how much of the difficulty comes with the type of writing. For each language they select formal sentences shorter than 140 characters and randomly sample 1,000. They use 500 to train the formal-text classifier and 500 to test it. The microblog comparison uses the classifier trained on tweets and the labeled Twitter test data. Both experiments provide training in the target style, although their training allocations differ.

Overall accuracy on the EuroParl test sentences is 99.4%, compared with 92.4% on the tweet test set. For Dutch, the figures are 99.6% on the formal sentences and 90.2% on tweets. For Spanish they are 99.8% and 91.2%. German has the highest tweet accuracy in this comparison, at 95.8%, with 99.4% on formal text. The paper reports a significant separation overall. The comparison establishes that short items can remain highly identifiable in one source while being substantially more difficult in another. It does not assign a share of the gap to individual factors such as spelling, names or multilingual content.

The tweet experiment then holds the target domain fixed and changes the profiles used by TextCat. With its supplied profiles, the classifier obtains 89.5% overall accuracy. With profiles trained on tweets, it reaches 92.4%. English rises from 88.4% to 94.8%, French from 86.2% to 90.0%, and Spanish from 88.0% to 91.2%. German is already at 94.6% with the supplied profiles and reaches 95.8% after training on tweets. Dutch scores 90.2% with either profile set. The differences by language suggest that adaptation is a useful intervention in this setup, with gains that depend on the language being recognized.

How much each source adds

The next comparison leaves the tweet-trained content classifier in place and adds one prior at a time. The weights shown in the results are selected on development data, and the chart reports accuracy on the held-out tweet test set. Because every row starts with the same content classifier, the comparison addresses how much an individual source contributes together with the tweet itself.

Individual contextual additions on the five-language Twitter test set

Author history gives the largest gain when added to the tweet's text.

Individual contextual additions on the five-language Twitter test setTweet text only: 92.4Tweet text only92.4Text with author history (this paper): 96.8Text with author history (this paper)96.8Text with linked pages: 92.8Text with linked pages92.8Text with mentioned accounts: 93.6Text with mentioned accounts93.6Text with shared hashtags: 92.7Text with shared hashtags92.7Text with preceding reply context: 93.0Text with preceding reply context93.0
The numbers
System or settingaccuracy %
Tweet text only92.4
Text with author history (this paper)96.8
Text with linked pages92.8
Text with mentioned accounts93.6
Text with shared hashtags92.7
Text with preceding reply context93.0

Author history receives a weight of 0.4 in this comparison. The combined system scores 95.2% for Dutch, 98.6% for English, 95.4% for French, 98.6% for German and 96.0% for Spanish. The gains extend across the language inventory. In particular, the Dutch result shows how an external source can help even when retraining the text classifier left its accuracy unchanged.

Mentioned accounts receive a weight of 0.3 and form the next strongest individual addition overall at 93.6%. The conversation prior also receives 0.3 and reaches 93.0%. Linked pages and tags, each at a weight of 0.2, produce overall accuracies of 92.8% and 92.7%, respectively. The table tests these additions against the tweet-trained content classifier. A small average improvement can reflect a helpful source reached by few posts, a weak source reached by many posts, or a mixture of improvements and new errors. The overall scores leave those possibilities open.

Fixed weights, voting and confidence

For the combined fixed-weight system, the development sweep gives 0.4 to the content vector, 0.3 to the author history, 0.1 to linked pages and 0.2 to mentioned accounts. The chosen combination reaches 97.2% overall on the test set. The tag and conversation priors do not contribute to that selected fixed-weight configuration. The best setting depends on how the sources work together. A source that helps when paired with text can have little additional value once another source already supplies similar evidence.

For beam confidence, the development experiments first compare how the beam count is converted to a weight. With a 10% beam, development accuracy is 95.4% with the exponential rule and 91.0% with the linear rule. The authors explore beams of 1, 5, 10 and 15% with the exponential mapping. They report development accuracy of 97.8% for 5%, compared with 97.6% for 1% and 95.4% for 10%. The 5% beam is selected for the final comparison. Its 97.8% development accuracy and the 97.4% test accuracy describe different splits.

Context combination rules on the five-language Twitter test set

Beam confidence has the highest overall accuracy, closely followed by fixed interpolation.

Context combination rules on the five-language Twitter test setText with author history: 96.8Text with author history96.8Fixed linear interpolation: 97.2Fixed linear interpolation97.2Majority voting: 95.8Majority voting95.8Beam confidence (this paper): 97.4Beam confidence (this paper)97.4Lead confidence: 95.6Lead confidence95.6
The numbers
System or settingaccuracy %
Text with author history96.8
Fixed linear interpolation97.2
Majority voting95.8
Beam confidence (this paper)97.4
Lead confidence95.6

The beam setting achieves 97.6% for Dutch and 99.4% for English, the strongest results for those languages in this comparison. Fixed interpolation yields 95.4% for French and 98.8% for German, while the beam scores for those languages are 95.2% and 98.6%. On Spanish, fixed interpolation and voting each reach 96.8%, and beam confidence reaches 96.2%. A classifier chosen by overall accuracy can therefore leave particular languages better served by a different decision rule in the same experiment.

Majority voting reaches 95.8% overall, below the system that adds author history alone to text. The authors trace most voting errors to ties and report that the score-based tiebreaker frequently makes the wrong selection in those cases. Lead confidence reaches 95.6% overall. Its 99.2% score for English is close to beam confidence, while its 90.6% for French falls well below the 95.2% beam result. Using a confidence measure is therefore an incomplete description of the improvement. The rule for deriving confidence changes which sources dominate the decision.

The combination table reports significance comparisons against the system that uses content with author history. The overall ordering of 97.4% for beam and 97.2% for fixed interpolation gives the best observed result in the experiment. Those values and annotations do not establish a significant separation between the two combination rules.

What happens with supplied TextCat profiles

The authors repeat the comparison using the profiles that come with TextCat to see whether their approach remains useful without training new profiles on labeled microblog text. The baseline scores 89.5% overall. Adding author history brings accuracy to 94.7%. The gain is substantial relative to the other single-source additions in that setting, and the best combinations again finish above author history alone.

Contextual classification with supplied TextCat profiles on the Twitter test set

Author history supplies the strongest individual gain and beam confidence gives the best overall combination.

Contextual classification with supplied TextCat profiles on the Twitter test setTweet text only: 89.5Tweet text only89.5Text with author history: 94.7Text with author history94.7Text with linked pages: 89.5Text with linked pages89.5Text with mentioned accounts: 90.9Text with mentioned accounts90.9Text with shared hashtags: 89.5Text with shared hashtags89.5Text with preceding reply context: 90.2Text with preceding reply context90.2Fixed linear interpolation: 95.4Fixed linear interpolation95.4Majority voting: 94.6Majority voting94.6Beam confidence (this paper): 95.9Beam confidence (this paper)95.9Lead confidence: 93.0Lead confidence93.0
The numbers
System or settingaccuracy %
Tweet text only89.5
Text with author history94.7
Text with linked pages89.5
Text with mentioned accounts90.9
Text with shared hashtags89.5
Text with preceding reply context90.2
Fixed linear interpolation95.4
Majority voting94.6
Beam confidence (this paper)95.9
Lead confidence93.0

In this setup beam confidence reaches 97.0% for Dutch, 97.8% for English, 91.8% for French, 98.2% for German and 94.8% for Spanish. The paper describes its best overall accuracy with the supplied profiles as about 1.5% lower than the best accuracy with tweet-trained profiles. The two settings illustrate different sources of improvement. Domain training can make an individual text comparison stronger. Adding related writing can make the final decision stronger even with general language profiles. The latter still relies on the availability of contextual texts, and fixed interpolation still needs development judgments to tune its weights.

Applying the classifier to a day of Twitter traffic

The authors use a separate collection of 1.1 million tweets from 2nd of March 2011 to study language use in the stream. They describe the GardenHose stream as a random sample of 10% of public Twitter posts. For languages outside their labeled experiment, they use profiles supplied with TextCat. The resulting rankings are based on predicted labels, with a candidate inventory much broader than the one used to measure test accuracy.

English, Japanese and Spanish are the most frequent classified languages. The paper reports that they account for roughly 63% of the collection. Its top five languages account for 82% and the top 10 for 92%. The long tail requires care. When the authors inspect tweets classified as Latin or Esperanto, they identify classification error as the explanation for those assignments. The paper also describes agreement with earlier studies about the most frequent languages, which provides a way to assess the broad ordering without validating each prediction.

The authors group posts by publication hour using their timestamps. The assigned languages show two common daily patterns. Japanese and Indonesian peak around 1 p.m. GMT and reach a low around 8 p.m. GMT. English, Spanish and Portuguese peak between 11 p.m. and 3 a.m., with a low at 7–9 a.m. GMT. The authors relate the difference to the locations of major populations using those languages. On conversion to the local times of the countries they discuss, the two patterns have peaks between 10 p.m. and midnight and lows at 4–5 a.m. This analysis characterizes the timing of classified posts during the collection period.

They also compare the classified totals with the interface-language field. The English interface accounts for 839,856 posts, while the classifier assigns English to 459,318. Spanish shows the opposite ordering, with 101,728 in the interface field and 142,401 under classification. Japanese has 185,360 by interface and 180,140 by classification. These are comparisons of totals. Similar totals for Japanese leave open whether the same tweets receive the label in both cases. The service's language options also exclude some languages commonly assigned by the classifier, including Portuguese and Indonesian.

Geographic information is available for 17,737 posts, spanning 34 countries in the paper's count. Brazil has 6,527 geolocated tweets and the USA has 4,616 in that field. The authors take the sparse availability of the field as a reason for its limited usefulness in their framework. Even when present, a country field describes where the message is associated geographically, which is a different property from the language of its text.

The feature counts show why the sources available to classify a tweet can differ across languages. Among tweets classified as Indonesian, 76.6% contain a mention. Among those classified as Portuguese, the figure is 44.8%. The Indonesian tweets with mentions average 1.8 mentions. English has the highest share of tagged posts among the five leading assigned languages, at 16.6%, with Spanish at 13.8%. Portuguese has 10.8% tagged posts, and these posts average 1.5 tags, the highest average in the group among posts that use tags. English also has the highest share of posts containing links, at 26.1%, with Spanish at 14.4%. A feature can thus be fairly uncommon in a language's posts while appearing repeatedly in the posts that use it.

What the ablations show

More appropriate training and more evidence solve different problems

The paper's controlled comparisons vary where the classifier learns its language profiles, which contextual sources it uses, and how it combines them. Changing the training material while keeping the tweet-only classifier gives a direct estimate of the value of in-domain profiles in this experiment. Dutch, where retraining leaves accuracy at 90.2%, is especially informative alongside the author-history result. The classifier gains from the context of Dutch tweets even though the new reference profile alone gives no measured gain. The two changes act at different points in the decision.

Testing each prior with the content classifier shows a large and consistent advantage for author history in the balanced test set. The history is directly connected to the writer of the target message and contains many more posts than the target provides. Averaging provides a way to use repeated language choices across those posts. The experiment does not vary history length independently or separate the contribution of extra text from the tendency of authors to keep using a language. Both are plausible parts of the result. A history-length comparison would address a different question from the one answered by adding the complete available history.

Mentioned accounts make a smaller but consistent contribution with the tweet-trained profiles. Their histories describe the people named or addressed, so the connection to the target language is indirect. The comparison with replies helps clarify what these sources offer. A mention can summarize a person's usual writing across many posts. A reply points to specific earlier words in a particular exchange. The reply source is more local to the interaction, while its short text can leave it subject to many of the same ambiguities as the target tweet. The individual-prior results combine the effects of these properties with the availability of each source.

Linked pages can be much longer than the target post, yet the link prior gives a smaller overall gain than the author and mention priors. This matters to the interpretation of the formal-text experiment. Extra text helps classify that extra text, but a strong language signal on a linked page transfers only when the page and the tweet align. A post may describe or respond to a document in another language. Shared tags have a related problem. A tag can provide access to many messages while grouping together authors who write in several languages.

How the weight changes the outcome

The authors vary the weight of each individual prior from 0 through 0.9 while using the content score for the rest of the decision. At 0 the curve begins at the text-only baseline. Near the other end, the contextual score supplies most of the combined value. The authors describe useful weights around 0.4 and find the author, mention and conversation curves relatively robust to changes in weight. Link and tag accuracy falls when the prior receives more than 0.4. The development choices for the single-source link and tag runs, both 0.2, are consistent with those curves. The exact best weight depends on the experimental comparison.

This sweep helps explain why a weak average gain need not make a source useless. A moderate weight can let a prior support the leading choice when the tweet and context agree. The same prior can introduce errors when it dominates an adequately informative tweet. The source's relation to the post matters here as much as how clearly its own text points to a language. The fixed interpolation weights measure the tradeoff across development examples. The post-dependent weights estimate it from the language scores available on an individual decision.

The beam experiment offers a comparison within the same idea of confidence. The mapping that decreases weight exponentially performs better than the linear mapping in the reported development comparison with a 10% beam. Changing width then changes the number of candidates likely to be counted as close competitors. The selected width produces the best reported development result among the settings highlighted by the authors. These sweeps show that the confidence heuristic depends on both its definition of a close competitor and the penalty imposed for having one.

Comparing beam with lead confidence tests whether looking beyond the runner-up is useful in the combined classifier. The beam gives the stronger overall result in both profile settings. This supports using the broader score ranking in this setup. It cannot isolate the value of inspecting extra candidates from the effects of the particular transformations used to assign weights. The two rules differ in how they quantify separation and in how their output enters the interpolation.

Voting supplies another comparison of what to keep from the vector. A vote preserves its top choice and discards most information about the closeness of the language scores, unless there is a tie. Fixed interpolation keeps all the scores and uses global weights. The weaker voting result, together with the authors' inspection of its ties, shows how reducing several sources to labels can create difficult decisions even when their underlying scores contain additional information. The fixed-weight result is closer to the beam result than to the voting result. Most of the overall gain in this comparison is available with a single set of weights learned in advance.

What the errors reveal about the sources

The authors examine mistakes from their final classifier and describe several ways the decision can fail. Some tweets contain fluent material in different languages. A post may include an original comment in one language and another message in a second language. Its character patterns genuinely support multiple candidates. A mismatch with the evaluation label can then reflect a disagreement over which part of the post should determine the answer.

Some mistakes involve named entities. The authors give examples that include an English-language band name inside otherwise Spanish writing and a personal name in a French message. With little surrounding text, a name can have disproportionate influence on the sequence rankings. Recognizing that a name belongs to the topic of a message would require a distinction that this character comparison does not make.

The authors also describe context-induced errors, such as a tweet that links to a page in a different language or a hashtag used primarily by a different language group. These are cases in which the prior can be decisive about its source and still mislead the classifier about the tweet. Finally, some posts are ambiguous at the level of the words themselves. One example has a brief affirmative expression alongside an emoticon and a mention. A human judgment can depend heavily on context when a fragment this short is shared across languages.

English is the destination of 54 out of 65 mistakes, or 83%, for the final beam setting in the labeled test. French supplies the largest number of incorrectly classified posts among the true labels. Because the test split has equal numbers per language, the tendency to assign English in errors cannot be attributed simply to an English majority in that split. The breakdown identifies an asymmetry in the decisions. The qualitative examples show several possible routes to it, without measuring how much each route contributes.

Limitations

Limits identified by the authors

The authors treat mixed-language tweets as an unresolved problem. The evaluation assigns a dominant content language and asks the classifier to reproduce it. The system cannot locate where language changes within a tweet, and it cannot preserve a second language in its output. The authors propose investigating approaches sensitive to changes within posts. They also identify the value of an explicit category for unknown or other languages. That matters when a tweet has insufficient writing for a decision or falls outside the candidate inventory.

The authors caution that absolute accuracy depends on the range of languages the classifier must distinguish. Their labeled experiment tests five. The stream analysis assigns labels across 69 languages, and the authors say they cannot manually evaluate all of them for the large collection. The mistakes they identify among assignments to Esperanto and Latin demonstrate that appearing in the predicted distribution is an uncertain test of a language's presence. The same problem applies to apparent absence. The ranking of common labels is easier to compare with earlier analyses than the totals for rare ones are to validate.

The paper explicitly leaves location out of the accuracy experiment. Location helped find candidate tweets for the labeled language groups, so giving it to the classifier would use information related to how those examples were selected. The authors also exclude the interface language, which offers seven choices at the time of the study. Their stream analyses describe differences between these fields and the system's predicted labels. Those analyses explain the authors' caution about the fields but do not estimate the accuracy of a classifier that uses them.

They point to more sophisticated evidence combination as future work and suggest that some of the features might be examined on SMS text. The experiments establish what the particular Twitter features contribute in their setup. Transferring a prior would require finding the corresponding relationship in another collection and measuring whether it carries comparable language information.

Limits of the experimental evidence

The balanced test set makes per-language comparisons straightforward, but it defines a particular evaluation population. The language proportions in the stream collection are different and include candidates outside the labeled set. An overall score from the balanced experiment should therefore be read as accuracy under that language inventory and sampling procedure. Changing the candidates, the mix of posts, or the proportion of ambiguous messages can change the aggregate result. The paper's preliminary formal comparison also uses a different sample and training allocation. It demonstrates a difficulty difference while leaving the exact contributions of length distribution, domain and training sample unresolved.

The paper's abstract describes testing on 1,000 posts, while the detailed experimental procedure specifies 1,000 selected tweets per language and 500 held out per language. The results here are described using the detailed split. The evaluation also omits tweets judged to contain only non-word material. This leaves the behavior on link-only or emoticon-only posts outside the reported accuracy, even though some of those posts might have useful related material. For multilingual tweets, agreement is measured against a single human choice. The paper gives examples of resulting errors, with no separate test of reliability for these difficult annotation judgments.

The retrieval procedure benefits from access to substantial histories and collections of hashtagged posts. The results report the average amount retrieved, without breaking accuracy down by history length or showing what happens for accounts with very little prior activity. Likewise, a whole-test score for links or replies does not establish how well the source works specifically on the posts where it is available. Differences in feature use among classified languages make that distinction important. A source can have low overall impact in a collection because eligible posts are sparse even if it contributes materially on those posts.

There is also a distinction between holding tweets out of profile training and holding authors or communities out of the evaluation. The stated split is by tweet. The paper does not report a separate accuracy test in which evaluation authors or tags have no overlap with the material used to select settings. Its history and tag definitions call for earlier posts, and its retrieval description gives no fixed extraction window. The study therefore does not quantify how performance changes under a strict prospective cutoff, or when little recent history can be retrieved. These would be relevant comparisons for an application concerned with language changes by an author or in a hashtag.

The adaptive beam rule is the best observed setting by overall accuracy, but the comparison to fixed interpolation is narrow and varies by true language. Its score measures separation among candidate languages within a source. It does not measure the chance that the evidence source uses the same language as the tweet. A widely shared tag or a page in another language can give a sharply concentrated score profile. The examples of prior-induced errors are concrete instances of the difference between a clear score and useful evidence. The ambiguities in the stated beam comparisons and score orientation also leave implementation details that matter for reproducing the exact confidence calculation.

Finally, the figures for Twitter use describe a single day and are grouped using the classifier's predictions. A systematic language error can affect both the size of a group and its measured feature use. For instance, if posts with foreign-language links are more frequently assigned the language of their linked pages, the classified group can acquire posts partly because they contain the very feature being counted. The study's aggregate feature and time comparisons cannot measure that effect independently. Likewise, contrasts with the interface totals reveal large differences between language signals, while leaving the true per-post agreement undetermined.

What came after

The later citing work places the paper alongside research on reusable language identification, broader assessments of the task, and processing of mixed-language social media. These connections can be described at the level of the cited works' stated subjects. Their citation of Carter and colleagues does not establish that they reused the tweet data, the five priors or the beam rule.

langid.py appeared in 2012 and addresses language identification with an off-the-shelf tool. It shares the practical question of how readily a language identifier can be applied to a new collection. Carter and colleagues examine that question by starting from supplied TextCat profiles and measuring what changes when Twitter context is available. The later tool treats ready-to-use identification as its subject. The connection concerns the role of a general-purpose starting point in an application where training material for the target domain may be hard to obtain.

Automatic Language Identification in Texts: A Survey, from 2019, places automatic text language identification in a broader survey. The microblog study supplies an instance in which properties of the input and the available relationships both matter to the classification problem. Its experiments give concrete examples of distinctions that a survey can bring together, including short formal text versus short informal text, profiles learned in the target domain versus supplied profiles, and text-only decisions versus decisions informed by associated material. The later work surveys the larger research area that contains those comparisons.

Code-Mixing in Social Media Text, from 2013, takes up language mixing as a subject in its own right. In the microblog paper, fluent multilingual tweets are an error category shaped by the decision to assign one label to the entire message. Work focused on code-mixing brings the coexistence of languages into the task definition. It addresses a phenomenon that can be hidden by retaining only the language judged to carry the most content. This is a continuation of the language problem exposed by the error analysis, with a different emphasis from improving overall document-level classification.

POS Tagging of English-Hindi Code-Mixed Social Media Content, from 2014, addresses a further processing task on mixed writing, part-of-speech tagging. The task assigns grammatical categories to units within the text. Carter and colleagues aim to give an entire post a language label so it can be selected for analysis. In the English-Hindi work's setting, grammatical analysis has to contend with the presence of both languages in the material being processed. The two tasks illustrate different uses of information below the level of the document. A character-ranking classifier gathers that information into a single decision, whereas grammatical tagging requires predictions about the individual units for which tags are assigned.

Cite

Cite as S. Carter, Wouter Weerkamp and Manos Tsagkias. 2012. Microblog language identification: overcoming the limitations of short, unedited and idiomatic text. Language Resources and Evaluation.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1007/s10579-012-9195-y

@inproceedings{carter2012microblog,
  title = {{Microblog language identification: overcoming the limitations of short, unedited and idiomatic text}},
  author = {S. Carter, Wouter Weerkamp and Manos Tsagkias},
  booktitle = {Language Resources and Evaluation},
  year = {2012},
  doi = {10.1007/s10579-012-9195-y},
  url = {https://doi.org/10.1007/s10579-012-9195-y}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/carter-2012-microblog-language-identification-overcoming-limitations/