UMUTextStats: A linguistic feature extraction tool for Spanish
Paper · 2022 · José Antonio García-Díaz, Pedro José Vivancos-Vicente, Ángela Almela et al.
Summary
The way a document is written can help identify what kind of document it is. A writer may repeat letters for emphasis, choose a distinctive set of verb forms, or make frequent use of colloquial expressions. Those patterns are useful to a researcher only if there is a consistent way to measure them. García-Díaz and colleagues developed UMUTextStats to make such measurements for Spanish. Their starting point was Linguistic Inquiry and Word Count, or LIWC, an established program whose Spanish dictionaries leave gaps in the treatment of grammatical gender and verb conjugation. The authors set out to preserve the simplicity of counting recognizable features while giving Spanish grammar a larger role.
UMUTextStats turns each document into a set of named measurements. Some count words from a list, some look for patterns across a sentence, and others use grammatical tags or calculate statistics such as vocabulary diversity. The tool keeps different versions of the same document available. A vocabulary lookup can use cleaned text, while a count of upper-case words can use the original. A configurable hierarchy groups these measurements by linguistic category, so a researcher can add a resource or define a new measurement without redesigning the whole extractor.
The paper evaluates the measurements in tasks including sentiment classification, hate-speech detection, author analysis, and the identification of satire and humor. On the infectious-disease sentiment dataset, the authors report that linguistic features alone gave the highest overall accuracy, at 55.3%. In a Spanish misogyny detection study, the strongest configuration described in the prose reached 85.175% accuracy with linguistic features and fastText sentence representations. In author analysis, linguistic features alone did better than BERT-based classifiers at predicting gender, while combinations with embeddings performed better for the remaining traits discussed by the authors. An embedding represents a word, sentence, or other unit as a vector of learned numerical values.
The experiments establish that recognizable language patterns can contribute to classification, with the gains depending on the task and the combination of inputs. They also help identify which measurements are associated with particular labels, such as offensive vocabulary in the misogyny study. The authors identify a persistent weakness in dictionary matching. A word can change meaning with its surroundings, and a dictionary hit in a short social media post can therefore offer a poor guide to what the writer meant.
Deep dive: UMUTextStats: A linguistic feature extraction tool for Spanish
UMUTextStats measures linguistic features in Spanish text, from verb forms to writing style, and tests how they help classify documents. · about 37 minutes to read
The problem and its context
What a classifier can learn from the way a text is written
A document classifier assigns a label to a piece of writing. In the research discussed by García-Díaz and colleagues, the label might describe the sentiment of a message, identify its author, or indicate whether it contains hate speech. The authors motivate these tasks with examples from online communication. Sentiment analysis can help researchers study attitudes toward products and services. Authorship analysis can help investigate questions about the origin of a text. The paper treats these as applications of a common problem in text classification.
The classifier needs a representation of each document. The paper describes how pretrained embeddings offer one way to build that representation. They place words in a numerical space learned from large collections of text. Contextual embeddings also use surrounding words to represent a word as it appears in a particular passage. That contextual information helps when the same written form has different senses. The authors describe this development in terms of the Transformer and attention.
The practical question for the authors is which distinctions that representation makes easy to use. A representation can reflect the subject of a message and still give researchers little visibility into whether a classifier used capitalization, inflection, or vocabulary range. Those are examples of measurements a researcher can define directly. A count of all-uppercase words has a recognizable meaning before a classifier sees it. If that count helps distinguish documents, the researcher can inspect the words and ask whether the count is picking up an aspect of style. The paper presents that inspectability as a reason to retain linguistic features alongside word embeddings.
Feature engineering is the choice of what to measure and how to represent it. Here, linguistic knowledge supplies much of that choice. It suggests looking at categories such as pronouns, marking the difference between a spelling variant and an accent mark error, or treating a construction with an auxiliary as a candidate unit. The output is familiar to a classifier because it is numerical. Its distinguishing property for a reader is that the measurements have names tied to explicit operations. The actions those names describe can be inspected even when the final classification uses several inputs together. This is the sense in which the paper connects feature design to interpretability.
What LIWC made practical
The authors describe LIWC as the established tool for this kind of work. Its basic operation is to match words against dictionaries arranged into psychologically relevant categories and express the matches relative to the text. Membership can overlap. A single word may contribute to more than one category, so the output describes several properties of the same material. The measurement is a category frequency, with the dictionary establishing what counts as evidence for that category.
LIWC distinguishes content words from function words. The former include classes such as nouns and adjectives, which help carry the subject matter of a message. The latter include forms such as articles and prepositions, which help organize what the writer says. The distinction mattered to the authors because frequent grammatical words may carry information about habitual expression even when they have little to do with the topic. The paper presents the linguistic distinction as one reason to examine a range of measurements beyond topical vocabulary.
The paper also describes how the dictionaries were developed. Earlier LIWC dictionaries were assembled manually and checked by human annotators. The 2015 version described in the paper contains nearly 6,400 entries in its master dictionary, whose contents include words, stems, and emoticons. The authors describe a procedure for checking how closely entries are related to others in the same dictionary and for using larger corpora to identify additional candidates. The Spanish dictionaries, according to the manual discussed in the paper, draw from the 2001 and 2007 versions. The paper situates this work within the use of word counts for psychological questions about language, an area connected to psycholinguistics.
Researchers had already used Spanish LIWC for opinion mining, depression assessment, deceit detection, and satire identification. The need for a new tool came from the authors’ experience with the grammar covered by the Spanish adaptation. The available categories left out grammatical gender distinctions they wanted to measure and covered fewer verb conjugations than they needed. A translated vocabulary can preserve a domain such as health or money while leaving out the distinctions encoded in the forms of words. For an analysis concerned with who is writing or how a passage is phrased, those forms can be the measurements of interest. This part of their case depends on morphology.
The authors raise a separate question about category design. A small group of people can build a useful dictionary, but the resulting category depends on their choices about which terms belong there. Moreover, a term count typically gives a hit the same meaning each time the form occurs. The same word can behave differently when nearby words change its interpretation. UMUTextStats addresses the design issue by making it easier to define and replace measurements. It addresses some cases involving context by letting a rule inspect larger units, use grammatical information, or specify exceptions. The stronger problem of interpreting a word in context remains central to the paper’s assessment of the tool.
The method, step by step
From a document to a set of measurements
UMUTextStats separates how a document enters the system from how its features are defined and how the measurements are delivered. A document can come from the console, a plain-text file, an archive containing separate files, or a dataset obtained through UMUCorpusClassifier. The extractor then has to decide which version of the text a feature will read, what unit it will inspect, and how it will turn the resulting matches into a number. Those choices are made for individual features, so they can differ across measurements of the same document.
A feature value can be understood by tracing it back through those choices. For instance, repeated exclamation marks are visible in the punctuation of a passage. To express their use as a percentage of sentences, the tool needs a representation that still contains the marks, a way to divide the passage into sentences, a rule for recognizing the pattern, and a record of how many sentences were examined. A feature for upper-case words needs a different unit and should read a version that retains letter case. Both may appear together in the same output without requiring a single preparation rule that suits both.
How UMUTextStats turns documents into linguistic measurements
The steps in order.
The hierarchy belongs to the configuration. Each document supplies the material on which the configured measurements operate. A category can collect several related features without making each one use the same kind of detector. A style category, for instance, can contain a measurement based on punctuation and another based on average word length. Grouping them describes why they belong together. Their implementations still determine independently what the numbers mean.
Preserving the information a feature needs
Internally, the tool wraps the document in an object called TextAsset. It stores the original and caches cleaned and normalized versions. An input can already supply a cleaned version when a study requires custom preparation. Otherwise, the tool removes blank lines and markup tags, strips URLs, mentions, and emojis, reduces letter elongation, and converts text to lower-case. The cached versions give an individual feature a consistent source to read when the same document is measured in several ways.
These operations improve some measurements for the same reason they would compromise others. Lower-case text reduces differences caused by capitalization when the purpose is to find a dictionary entry. The number of words typed entirely in capitals depends on those differences being preserved. The same applies to social media markers. Removing a mention reduces interference for a word lookup, while the presence of a mention is itself a measurement in the social media category. The originals and the prepared versions let both questions be asked of the same input.
Expressive lengthening gives another example. A writer can repeat a letter so that the written form conveys extra emphasis. Reducing the elongation can make the underlying word easier to match to a lexicon. A search for the elongation has to see the repeated letters. The feature design therefore treats normalization as a choice about which evidence a particular measurement needs. The choice applies at the level of the feature even though the alternative versions are kept at the level of the document.
The tool also offers optional spelling correction through PSPELL. It considers words individually and takes the highest-ranked suggestion when its similarity to the original exceeds a threshold. The decision is based on how close the forms are. A correction therefore has a different purpose from a spelling feature, which records evidence of a departure from the expected form. The paper also describes counting incorrect accentuation through PSPELL. In the descriptions of the error features, the tool checks the top suggestion against the word being examined. The general cleaning description supplies the similarity rule for replacing a form, while the feature descriptions focus on counting the errors.
Specifying an individual measurement
An XML file defines the tree of categories and features. A configured measurement chooses a feature class, which determines the operation the program carries out. Its settings can then provide items such as a word list, a matching pattern, or a separator. The point of using feature classes is that new measurements of familiar kinds can be expressed through new definitions. Another vocabulary domain can use dictionary matching, for instance, without requiring a different mechanism for operating on a list of terms.
In the dictionary class, an entry can be a keyword or a regular expression, which is a rule for recognizing a pattern in text. A dictionary can use literal matching when pattern interpretation is unnecessary, an option the authors include to speed up the operation. It can also include counterexamples. These allow a rule to match a general pattern, with exceptions recorded separately. That arrangement is especially relevant when a spelling pattern works in many cases but has familiar exceptions. A user reading the configuration can examine the generalization and the exceptions together.
The pattern class can count occurrences that match a regular expression. A related class measures sentences that match a pattern, for instance to count sentences containing an expression associated with the passive voice. Where the class supports different separators, the researcher can select words or sentences, or have the pattern applied to the document as a whole. This part of the configuration matters because the choice of units sets the scope of the match. A word-by-word operation can inspect the shape of each word. An operation over a sentence can inspect material that spans boundaries between words. The selection of units is related to tokenization.
The paper’s punctuation example is a sentence-based pattern configured to recognize text ending in repeated exclamation marks. The rule looks for letters, digits, or whitespace followed by at least two marks. The sentence separator means the program can express the result relative to the number of sentences. A researcher could read the resulting feature as a measure of how frequently the text uses this specific form of emphasis. The pattern itself supplies the operational definition. Its scope is narrower than the everyday category of exclamation, which a reader may recognize through phrasing and punctuation that the expression does not select.
Counts and percentages serve different purposes in this system. A raw count describes how many occurrences the detector found. A percentage relates the result to the group of units being measured. When those units are sentences, a sentence-level percentage refers to the sentences in the input. For a word-based measurement, the relevant population is words. A percentage of sentences with the configured emphatic punctuation and a percentage of words in capitals can both indicate a style of emphasis, but they describe different kinds of opportunities for its occurrence. The configured separator is therefore part of the meaning of a percentage.
Measuring Spanish grammar
The verb feature class stores forms in plain-text resources, as the dictionary class does with its entries. The authors give verbs a dedicated implementation because of the number of forms that have to be handled. They describe lookup as a constant-time operation. This claim is about identifying a candidate in the resource. Extracting features across a document still involves inspecting its material, and the paper gives no end-to-end processing time tied to the lookup claim.
A specialized separator can allow an auxiliary to stay with the form it accompanies for matching. That is important for compound tenses and verbal periphrases, where the construction may take up several written words. If the analysis inspected each written word independently, a match could register an auxiliary without counting the complete construction. The authors’ goal was to include the range of Spanish verb tenses, with these multiword forms considered alongside forms that can be recognized within a single word. The paper describes the specialized classes and matching choices that make this possible, while leaving the detailed inventory of forms outside its methodological account.
Grammatical gender has a class of its own. It extends the dictionary mechanism by combining general rules with exceptions and by restricting the words eligible for matching according to their grammatical category. This is relevant because a pattern in a word ending can occur in a form to which the intended grammatical rule should never apply. Using a grammatical tag as a filter reduces the number of candidates the rule has to consider. The paper also describes features that capture number and other properties of word structure within the morphology and syntax category.
For grammatical tags the tool relies on Stanza. The tags distinguish categories such as adverbs, adjectives, determiners, and pronouns. UMUTextStats can count tokens assigned to a chosen category, or use the assignment as evidence inside a more specialized feature. In a general count the category is the property being measured. In the gender detector it helps decide whether a further rule should be applied. This distinction illustrates how the same upstream analysis can provide a measurement and support other measurements through part-of-speech tagging.
The extractor also has a feature class for enclitic personal pronouns. Spanish forms such as lo, la, and le can be attached to a verb and function as objects. A count for attached forms makes this construction visible in a way that counting stand-alone pronoun tokens would miss. The class adds another sort of information about word structure. The word as it appears in the text is an input to the match, while the measurement concerns a grammatical element that can be part of that word.
Stanza also supplies entity categories. The Spanish component described by the paper covers people, locations, organizations, and a miscellaneous category. A configured feature counts words assigned to one of those categories. This offers information about the kinds of named items that appear in a document alongside ordinary grammatical distributions and topical lexicons. The category annotation comes from upstream named entity recognition.
Measuring vocabulary, length, and writing conventions
The stylometric features describe observable aspects of writing style. Some are direct counts of words, sentences, syllables, or selected characters. Others look for words of a configured length or calculate average word length, words per sentence, or syllables per word. A character feature can group differently represented symbols that a researcher wants to measure together. The paper gives the examples of quotation marks, currency signs, brackets, and prime symbols. Such a feature makes the configuration responsible for defining the set of characters included in a single measurement.
Variation in vocabulary is represented by the standardized type–token ratio. The paper states the underlying calculation as the number of distinct words divided by the number of words. In symbolic form, the ratio for the unit being measured is the one used in the type–token ratio.
R = U ÷ T
R is the resulting ratio. U is the count of distinct word forms in the unit, and T is the count of all word occurrences there, including repetitions. The symbol ÷ means division, and = identifies the value of R with that calculation.
For a long document the class can calculate this ratio in chunks. The paper uses N for the number of words in a chunk. Measuring comparable spans addresses the concern that a longer sample gives a writer more opportunity to repeat words that have already occurred. The tool can also use the standard deviation of the chunk ratios as a feature. That number describes how much the ratios vary across the chunks. A separate class returns the distinct-word count itself, which describes the number of observed forms without expressing it relative to the number of occurrences.
The paper names a Flesch–Szigriszt measure of perspicuity and a Fernández–Huerta readability score. Each has a feature class. The paper names the measures and the sources for them, leaving their equations and coefficients to those sources. It likewise describes composite features through their operations. They can form a new measurement by averaging existing values, adding or subtracting them, or selecting a minimum or maximum. The computation depends on what operands the feature definition chooses. A composite is consequently a way to derive another value from measurements that the extractor can already make.
The correction and style features examine departures from spelling and writing conventions. The authors distinguish orthographic problems, stylistic habits, and performance errors. A missing written accent is an orthographic observation. Starting several sentences with the same word is a stylistic observation. The performance category is motivated by slips that a writer might make in spite of knowing the relevant convention. The detectors operate on the text itself, such as a sequence of repeated words or a configured expression. Whether a writer knew the convention at the time of writing is a separate question.
Other classes count sentences that begin in lower-case or start with a number. The authors treat these as signals of particular writing habits. The paper includes examples from Spanish usage that involve joining words where the conventional spelling separates them, separating words where the convention joins them, or adding or omitting a written accent. The categories can record these as distinct measurements. That helps an analysis distinguish frequent unconventional capitalization from frequent accentuation errors even when both occur in documents that a broad spellchecker would flag.
Grouping evidence about meaning and use
Beyond grammar and style, the hierarchy includes measurements for phonetics, semantics, pragmatics, lexis, psycholinguistic processes, register, and social media. These groupings express different reasons to count a form. A word may belong to a vocabulary concerned with a particular subject and also contribute to a measure of register. The system can retain those relations as separate measurements. Researchers may then see whether the subject domain or the way it was expressed is more closely associated with a label.
The written phonetics category is narrow. Its feature concerns expressive lengthening, a way of repeating letters to suggest emphasis in a written message. The pattern class recognizes repeated character sequences. The typography class can separately count lower- or upper-case words. The authors treat such markings as indications of emphasis or loudness in writing. The measurements concern visible textual behavior, so interpreting them as properties of an actual spoken delivery would require separate evidence.
The semantics category covers conventional expressions or words linked to phenomena such as onomatopoeia, euphemism, dysphemism, and synecdoche. These distinguish forms that evoke a sound, soften an expression, make it more derogatory, or use a part to stand for a whole. The usefulness of a feature in each group depends on which expressions its underlying resource recognizes. In these cases the category name states the phenomenon motivating the measure, while the rule defines what counts as an occurrence for the purposes of semantics.
The pragmatics category concerns ways expressions are used in communication. The paper mentions rhetorical questions, figurative devices such as hyperbole and simile, and conventional forms of greeting or condolence. It also lists markers that help organize discourse, such as expressions that connect, reformulate, or advance an argument. These features can flag recognizable constructions or expressions. Their presence supplies evidence that can be counted, with the interpretation of a particular occurrence still depending on how the passage uses it. This is especially relevant to discourse analysis.
Lexical categories collect vocabulary associated with domains such as health, occupations, money, and crime, as well as more abstract topics such as achievement and risk. An item in the lexis can consist of several words. The authors use New York City as an example of a lexical unit for which a sequence of words forms an identifiable expression. This is one reason the scope selected for matching matters. Expressions whose meaning or identity depends on neighboring words motivate features that can handle idioms and multiword expressions.
Psycholinguistic measures include lexicons for emotion and for positive, neutral, and negative attitudes. Register measures include vocabulary associated with informal, offensive, or learned expression. These groups make it possible to ask different questions of the same passage. A document may have frequent informal forms but few entries in an emotional vocabulary. Another may have a strong attitude expressed in a formal register. The configured measurements keep these properties available to the classifier as distinct inputs.
The social media category was included in part to demonstrate extensibility. It counts site-specific phenomena such as hashtags, mentions, and links, and includes a feature for identifying replies directed to particular users based on a list of names. These are concrete properties of the source documents. They may help characterize a message or an account’s writing habits in a social media dataset. They also illustrate why having the original text available matters even when the same document has been stripped of platform-specific forms for other measurements.
Delivering the measurements for classification
The output resolver can deliver the values in CSV, ARFF for WEKA, JSON, HTML for viewing, or a table in the console. The authors describe terminal use and a browser interface, and they report a demonstration of UMUTextStats. The output is a representation of each document with feature names and values. The same extraction stage can consequently support different classifiers or an analysis of individual features, depending on what the researcher does with the measurements afterwards.
Feature extraction and classifier training are distinct operations in the studies. The configured rules create the linguistic representation. Labeled examples are then used to train a classifier on that representation, on embeddings, or on combinations of the two. The paper uses the term knowledge integration for a strategy that brings features together within the classification procedure, and ensemble learning for combining evidence through multiple predictors. Which procedure was chosen, and which comparisons it supports, varies across the applications. The paper does not specify a common training protocol for all of these uses of machine learning.
The sentiment study also uses a domain ontology, a structured description of aspects of infectious disease. The authors describe relating each document’s sentiment to the aspects using a custom TF–IDF calculation. TF–IDF weights terms using evidence from their frequency within a document and their distribution across documents. In the account here, the predicted sentiment also affects the connection to concepts expressed directly or indirectly. The paper does not give the equation for its custom version. This is an application-specific stage that uses TF-IDF after the general feature extraction work.
Experiments and results
How to read the collection of experiments
The evaluation brings together applications with different prediction targets. Some ask for a binary decision, such as whether a message is sexist. Others have several possible class labels, such as the range of political positions in an author analysis task. The prose discusses feature and classifier comparisons for selected studies. A cross-task table gives scores by dataset and task, with its caption identifying F1 as the metric. F1 summarizes the balance between finding relevant cases and making correct positive predictions. Accuracy describes the share of decisions that are correct overall. The two measures answer different questions about evaluation.
Several values appear with different metric descriptions in the prose and the cross-task table. The sentiment study, for instance, is described in prose using accuracy, while the entry for the infodemiology dataset appears under the table’s F1 caption. The most meaningful comparisons are the ones for which the paper identifies the options and reports what changed, such as features alone versus features combined with embeddings. The table shows the range of applications and gives reported scores for individual task settings. A score from one setting cannot by itself establish that the corresponding task was solved more effectively than a different setting with a different label set.
The studies also have different levels of procedural detail. The paper explicitly describes the folds for the infectious-disease sentiment experiment. For many shared-task entries it supplies the dataset, language, label setting, and score or place in the rankings. It does not consistently label train, validation, and test partitions or describe the averaging of F1. The figures below are therefore tied to the tasks, metrics, and evaluation procedures the authors actually identify.
Sentiment in discussion of infectious disease
The infodemiology application concerns posts related to infectious diseases in Latin America. The cross-task table describes its sentiment classification dataset as multiclass and written in Ecuadorian Spanish. An ontology supplies the aspects about which the documents can express sentiment. The classifier assigns the sentiment, and the subsequent calculation relates it to the aspects. The ontology thus defines the subject concepts of interest, while the labeled documents supply examples for training and evaluating the sentiment classifier.
The study uses ten-fold cross-validation. The documents are divided into folds so the classifier can be evaluated on a held-out portion while training on the others, with the held-out portion rotating. The authors compare linguistic features with pretrained word embeddings and test combinations in neural architectures, including recurrent and convolutional classifiers. The paper describes the overall result for this procedure in terms of accuracy, rather than giving separate figures for the folds.
The best overall accuracy reported in the prose is 55.3%, obtained with linguistic features alone on the infodemiology dataset. Most neural architectures described improved in accuracy when linguistic features were added, with the convolutional classifier as the exception. These two findings can coexist. Adding a useful signal may improve a classifier relative to its own input configuration, while a simpler feature setup remains stronger overall. The paper does not give the individual accuracy values necessary to establish the size of those improvements.
In the same study, the authors report that numerals are negatively associated with sentiment and that colloquial usage is positively associated with positive documents. A lexical or grammatical measurement can support this kind of analysis because the researcher knows what occurrences produced it. The result describes associations within this corpus. A numeral may accompany a different tone, topic, or kind of report. The reported relationship leaves these explanations open and does not specify a causal effect of number use on the sentiment people express.
The table gives 55.3 for the infodemiology row under its F1 caption. The prose labels 55.3% as accuracy for linguistic features alone. The paper does not explain the relationship between the two entries, so the prose establishes the accuracy figure for the stated configuration, while the table’s metric label has to be read as printed. The table also lists 35.8 for multiclass sentiment classification on TASS 2020. It gives less detail about the comparison behind that entry, so it primarily documents another use of the extractor in Spanish sentiment classification.
Misogyny, sexism, and offensive language
The misogyny study uses Spanish text and compares classifiers trained with several groups of features, both separately and in combination. The authors report that linguistic features alone outperform the word embeddings and noncontextual sentence embeddings considered individually. Their best result described in the prose uses a support vector machine, a classifier that draws a decision boundary using the input features. It has both the linguistic measurements and sentence embeddings from fastText as input.
That combination achieves 85.175% accuracy in the misogyny experiment as reported in the prose. The cross-task table gives 90.52 for MisoCorpus under its F1 caption and describes its setting as binary classification in Mexican Spanish. The paper does not supply a split or configuration mapping that would establish how the latter entry relates to the accuracy result. The two figures therefore characterize the study at the levels at which they are reported, with the named classifier and input combination attached to the accuracy figure.
The authors examine the 20 leading linguistic features in the misogyny study using information gain. In this setting, information gain describes how much knowing a feature helps reduce uncertainty about the label. The discussion connects misogynous messages with offensive language, grammatical gender measurements, and features in the correction and style category. A grammatical-gender measurement here describes the forms present in a text. It is a different variable from the label for an author’s gender used in the political author analysis.
A separate comparison examines knowledge integration and ensemble learning for combining linguistic features with word and sentence representations. The datasets are MisoCorpus 2020, HaterNET, AMI 2018, and HatEval 2019. The authors report the strongest performance for knowledge integration in this comparison. The table gives F1 entries of 84.08 for HaterNET, 84.72 for AMI 2018, and 77.27 for HatEval 2019, each marked as a binary setting in Spanish. Those rows do not break the scores down by combination strategy, leaving the strategy comparison qualitative in this paper.
The results for sexism in EXISTS 2021 were more limited in the authors’ account. They tried combining the features with Transformer embeddings through knowledge integration and through an ensemble. Their use of linguistic measurements for English was restricted to stylometry. The table lists a binary setting scored at 75.14 and a multiclass setting scored at 53.62, with Spanish and English involved in both and F1 named for the table. That distinction matters because the reader is seeing scores for different label structures, while the experiment’s linguistic input also differs by language.
On MeOffendES, the paper describes offensive-language experiments involving European and Mexican Spanish. The team placed second and fifth in the binary classification tasks and first in subtasks using contextual features. The table includes an F1 entry of 87.82 for a binary Spanish setting. The ranking and the table score describe different aspects of the evaluation. A ranking compares a submission with other submissions on a task. The reported score describes the evaluation metric for the table entry. The prose does not give a separate score for each placement or enough detail to attribute a ranking to the linguistic measurements alone.
Author attributes and author identity
The author analysis study uses tweets by Spanish politicians collected in 2020. Author profiling predicts a trait of a writer, such as an age range or an ideological grouping. Authorship attribution identifies who wrote the material. The paper evaluates both kinds of application. The table includes a selection of trait-prediction settings for PoliCorpus 2020, while the prose discusses how combinations of input features behave across traits and how the most informative kinds of measurements change for author identity.
In gender prediction, linguistic features by themselves outperform the BERT-based comparison described in the prose. For the remaining traits discussed there, a combination of linguistic and embedding-based features does better than either kind of input used separately. The published table does not pair each overall result with its component scores. The chart consequently shows the reported F1 across prediction settings on PoliCorpus 2020. Its star marks the highest reported value on that corpus in the table.
Reported F1 across author profiling settings on PoliCorpus 2020
Binary ideology prediction has the highest reported score across these profiling settings.
The numbers
| System or setting | F1 score |
|---|---|
| Gender, binary | 72.02 |
| Age range, multiclass | 46.69 |
| Ideology, binary (this paper) | 98.04 |
| Ideology, multiclass | 91.05 |
The binary and multiclass ideology settings ask the classifier for different levels of distinction. A higher score on the binary task is consistent with the broad labels being easier to distinguish, but the table alone leaves open how the class distributions and evaluation procedures contribute to the gap. The other rows change the trait itself. They give a view of the variability of the reported results within the corpus, with no common calculation in the paper assigning that variability to a single feature class or classifier.
The authors’ feature analysis gives more detail about the difference between profiling and attribution. They associate profiling primarily with vocabulary and morphosyntactic features, and attribution more closely with stylometry. The distinction is informative because a trait shared by several people can be associated with the topics or grammatical forms they use, while identifying an individual can benefit from habits in how a passage is written. The political ideology feature analysis is presented for a multiclass setting. The figure caption calls its corpus Spanish PoliCorpus 2021, whereas the table uses PoliCorpus 2020. The paper leaves the naming difference unresolved, so the chart follows the table’s identification of its rows.
Satire, irony, humor, and emotion
Satire and irony appear in the table as a collection of binary tasks. SatiCorpus 2021, a Spanish satire dataset, has a reported F1 entry of 97.32. Another Spanish satire dataset has a listed score of 90.00, and two entries credited to a further satire study show 95.63 and 92.84. The brief labels identify those latter entries as binary Spanish settings. They give no experimental detail that would support inferring a particular cause for the difference between those scores.
The IrosVa 2019 irony task has separate binary entries for language varieties. The reported F1 is 70.94 for the setting labeled Spanish, 66.40 for Mexican, and 66.34 for Cuban. These entries document the application of the features across the settings. They are scores on distinct varieties and cannot isolate a difference due to dialectal coverage, since the paper does not give a comparison controlling for the other properties of the datasets.
In Spanish humor analysis, the authors report first place in funniness score prediction and third place in classification of the target of the humor. In the table, the HaHa 2021 results include F1 of 85.44 for binary humor classification, 20.87 for multiclass mechanism classification, and 32.25 for multiclass target classification. Mechanism and target pose different questions about a humorous message. The former concerns how the humor works, while the latter concerns whom or what it is directed at. The ranking for predicting funniness and the F1 entry for binary humor detection concern separate outcomes.
For English, the prose gives an F1-score of 91.60% for humor identification and 57.22% for detecting humor controversy in HaHackathon. The table gives 91.60 for its binary English entry and 46.50 for an English multiclass setting described as controversial. The text does not establish that the latter setting and the controversy result in the prose share the same configuration or label structure. It is therefore possible to state the prose results as reported and identify the multiclass table entry separately.
In Spanish emotion analysis, the team reached sixth place in the task discussed in the prose. The table has two multiclass EmoEvalEs entries at 66.84 under its F1 caption, with no distinguishing configuration given in their row descriptions. Emotion analysis here forms another task family in which the authors tried linguistic measurements. The paper gives the placement and overall scores, while weaker or stronger performance for individual emotions would require results by label. The distinction matters for measurements that cover sentiment and emotion.
Applying style measurements beyond Spanish prose
The authors also entered AI-SOCO 2020, a source-code authorship identification task. Their system combined stylometric features with character n-grams, which are sequences of adjacent characters. This tests whether some of the general measurements of form can help identify authors in text with a different structure and purpose from social media posts. The character sequences offer direct evidence about recurring forms, while the style features supply explicitly defined statistics. The experiment adapts the same general distinction between measured properties and other representations to the use of an n-gram in classification.
The prose reports sixth place and 91.16% accuracy for the source-code submission, ahead of the RoBERTa baselines mentioned there. The table’s AI-SOCO 2020 row prints 91.16 under the general F1 caption and gives the task as multilingual and multiclass. As in the sentiment experiment, the paper does not reconcile the metric labels. The prose specifically connects the accuracy figure and baseline comparison to the character and style combination. Separate scores for the components would be needed to estimate how much each contributed in this task concerning code and programming languages.
The paper also describes participation in studies using Tamil and Arabic. The Tamil applications include emotion detection, identification of signs of depression, and classification of several kinds of abusive comments. The Arabic application concerns sarcasm detection. These accounts establish that the authors tried the features in different language settings. The paper supplies no scores for those applications, and the documented English use in the sexism task explicitly limits its linguistic input to stylometry. Together these examples show a narrower path to portability through general features of text form.
What the ablations show
Comparisons at the level of feature sets
The paper reports no systematic ablation that removes individual UMUTextStats components and instead offers feature-set comparisons, comparisons of ways to combine inputs, and analyses of association with task labels.
The sentiment comparison separates linguistic features, pretrained embeddings, and combinations. The linguistic representation alone comes out strongest in the prose account. Adding it benefits the recurrent and most other neural configurations discussed, with the convolutional configuration as the exception. The opposing behavior across architectures matters because it shows that the effect of including the measurements depends on how they are used. The success of the stand-alone linguistic representation also establishes that the features in this application have predictive value without requiring the accompanying embeddings.
The misogyny experiment supplies a different pattern. The linguistic features do better than the word and noncontextual sentence representations when evaluated individually. The strongest configuration then uses both linguistic measurements and fastText sentences. For this particular support vector machine result, the useful question is whether the feature groups provide complementary signals. The relative results support that interpretation at the level of the full groups. To identify the source of the complementarity, an experiment would need to compare the same setup with specific subsets removed, such as the offensive lexicon or the grammatical measurements.
The cross-dataset hate-speech work compares integration and ensembling. The authors report better results for integration. This shows that the outcome can change with the way the classifier accesses the feature sets. In an integrated setup the learned decision can use measurements from the combined representation. An ensemble combines predictive evidence across separate constituents. Training details and results by strategy would be needed to determine which mechanism accounts for the reported ordering, particularly because the paper brings together datasets with different kinds of language and annotations.
The author profiling comparison has a clear exception to the broader pattern of benefits from combining inputs. For gender prediction, linguistic features alone did better than the BERT-based comparison. For the remaining traits, the authors report a benefit from the combined representation. The result gives the linguistic features a different role depending on the target. In one case they provide an effective representation on their own. In the others they add predictive information when used with embeddings. The table values for the traits show the breadth of the evaluation, while the prose is where the authors identify these relative outcomes.
Associations between measurements and labels
The paper uses rankings and associations to inspect features behind the classification results. These analyses answer questions about which observed properties carry information about a label. An information-gain ranking places measurements higher when their values reduce uncertainty about that label. A reported positive or negative association addresses the direction of a relationship. These are complementary descriptions of the data, and they have different interpretations. A feature can carry information even when the relationship cannot be summarized as a simple increase or decrease.
In the infectious-disease study, the discussion links colloquial expressions to positive texts and reports a negative association for numerals. The accompanying figure caption describes the panels as information-gain analyses, while the prose reports directional correlations for sentiment. The paper gives no coefficients for those reported directions. Both parts of the description should be read at the level of evidence they supply. The ranking concerns informativeness, and the prose identifies which direction the observed relationships took.
For the misogyny dataset, the authors single out offensive wording, grammatical gender, and correction and style. These families describe different properties of the same messages. A single message can carry a lexicon hit and a grammatical pattern, and repeated co-occurrence can make both useful for predicting the label. An information-gain ranking can surface both of them. To establish the contribution of either one in the full classifier, the relevant comparison would keep the rest of the input fixed and remove that feature or group.
The author study gives a related comparison between families of measurements. For profiling, the authors find vocabulary and morphosyntax more effective. For attribution, they favor style measurements. The distinction is useful as an interpretation of where the signal may be coming from. It indicates that predicting a shared trait and recognizing an individual’s writing draw differently on the measurements available. The paper does not provide a complete series of family-by-family scores under identical conditions, so the reported distinction remains an analysis of those tasks instead of an estimate of a general advantage.
Limitations
Limits identified by the authors
The main limitation the authors identify is the behavior of dictionary features on words with more than one sense and on figurative expressions. A word can qualify for a dictionary category even when it has a different meaning in the passage. A phrase that normally behaves as a conventional expression can also be intended literally. Short social media posts make the problem more conspicuous because they offer little surrounding material. A hit still faithfully records that the configured detector found a form. Interpreting what the speaker meant is a larger task.
The authors’ use of rules with sentence scope, exceptions, and grammatical information helps with patterns that can be specified in advance. A grammatical tag can rule out a candidate for a gender rule. A regular expression can include the words needed to recognize a particular construction. The unresolved cases are those where the meaning depends on a wider or less predictable context. A more extensive vocabulary can improve the coverage of a detector while still leaving it sensitive to the difference between a word’s conventional sense and its current use.
The conclusion describes a possible response based on extracting a small selection of features for individual tokens and feeding their sequence to a recurrent classifier. Document-level percentages keep totals visible but lose the order of the occurrences. A sequence of features could give the classifier evidence about which measurements appear near each other. The authors also describe adaptation to English and different Spanish dialects and further work on expanding and validating the category hierarchy. These are research directions named in the conclusion. The paper provides the evaluation summarized above for the document-level approach.
Limits of what the evaluation establishes
The classification studies demonstrate uses of the extracted features. The accuracy of each underlying detector is a separate question. To establish how well the verb classes recognize Spanish verb constructions in ordinary text, for instance, the evaluation would need to compare their matches with annotated examples of the constructions. The classification scores cannot supply that comparison because the target labels concern properties such as sentiment or authorship. The same distinction applies to the grammar rules, the accent checks, and the patterns intended to detect figurative usage.
Performance also depends on the resources and text version behind a measurement. Grammatical and entity counts inherit the choices and mistakes of Stanza’s analysis. The entity categories available in the Spanish component set the range of distinctions that can be counted. Spelling features depend on PSPELL’s suggestions and on the choices made in the preparation of the text. When a study supplies its own cleaned input, that preparation becomes another part of the measurement procedure. The paper describes these mechanisms without testing how sensitive the final classifications are to changes in each resource or preprocessing option.
The comparison to LIWC is primarily a motivation and a comparison of coverage. The authors point to grammatical distinctions they want to capture and describe the machinery for defining such features in UMUTextStats. The reported experiments largely compare linguistic inputs with embeddings or compare strategies for combining those inputs. A matched evaluation with LIWC would be needed to quantify the effect of changing extractors on the same tasks. The reported results do not isolate that effect, nor do they tell the reader how much of any gain comes specifically from Spanish verb or gender coverage.
Some experiments show that the presence of the linguistic features is associated with better performance for a particular classifier. Their relative performance has to be read together with the task, the embeddings used, and the training procedure. A gain from a combination can come from many measurements contributing in small ways, or from a few that are particularly well suited to the data. The reported bundle comparisons establish that the input can help as a group. They leave the contribution of individual feature classes, and the stability of those contributions across corpora, open.
The interpretability claim also has a limited scope. A named variable makes it possible to see what was measured, and a ranking can show which variables are informative about a label. Explaining a particular classification requires evidence about how the trained classifier used those variables in that case. A grammatical-gender count, for instance, can be informative in the misogyny data even though its contribution differs across examples and accompanies other properties of the message. An association is evidence about the dataset. A causal account of the label or the language behavior needs a different design.
Cross-task scores introduce further uncertainty. The paper does not consistently report partitions, metric averaging, or score breakdowns by class. It occasionally uses accuracy in the prose for a value also printed in a table captioned as F1. The figure and table also give different year labels in their references to the political corpus. These issues limit numerical comparisons beyond the explicitly described settings. Where the paper gives rankings in shared tasks, the rankings establish how a submission placed under that task’s conditions, with no matched control showing how it would place with an individual feature omitted.
Finally, the cross-language examples support portability for selected measurements. Counts of characters, lengths, and repeated forms can be applied to different kinds of material under the procedure described. The Spanish grammar and lexicons are a different part of the tool. Features based on conjugation, accentuation, discourse markers, and conventional expressions depend on coverage appropriate to the variety being analyzed. The English restriction in the sexism study and the authors’ plans for dialect adaptation make the scope of the existing evidence especially clear. Classification across the listed languages shows that some features travel. It leaves the wider transfer of the Spanish-specific inventory unmeasured.
What came after
The paper documents a tool that had already been used in several application studies by the time the authors described its architecture together. No subsequent study is documented here with enough information to say which mechanism it adopted, how it changed that mechanism, or what it measured. The sentiment, hate-speech, authorship, and humor studies discussed above are applications reported by the authors in their evaluation.
The continuation the authors describe starts with the difference between document counts and sequences. Their existing measurements can say how often certain linguistic properties occurred in a passage. Their proposed token-level work asks whether a recurrent classifier can use where selected properties occur and what surrounds them. The conclusion gives this as a response to the trouble dictionary features have with changes of sense and figurative language. An evaluation would need to determine whether keeping order improves the decisions in those contexts.
The authors also point to two kinds of development for the resource itself. Adaptation to English and to more Spanish dialects concerns the fit between feature definitions and the language of the input. Extending and validating the hierarchy concerns the scope and organization of the measurements. The distinction is concrete in UMUTextStats. A general count of capitalized words may travel easily, whereas a measurement for a verb construction depends on which forms and combinations the extractor recognizes. The paper leaves the effectiveness of those extensions as an open empirical question.
Cite
Cite as José Antonio García-Díaz, Pedro José Vivancos-Vicente, Ángela Almela and Rafael Valencia-García. 2022. UMUTextStats: A linguistic feature extraction tool for Spanish. Proceedings of the Thirteenth Language Resources and Evaluation Conference.
@inproceedings{garciadiaz2022umutextstats,
title = {{UMUTextStats: A linguistic feature extraction tool for Spanish}},
author = {José Antonio García-Díaz, Pedro José Vivancos-Vicente, Ángela Almela and Rafael Valencia-García},
booktitle = {Proceedings of the Thirteenth Language Resources and Evaluation Conference},
year = {2022},
url = {https://aclanthology.org/2022.lrec-1.649/}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/diaz-2022-umutextstats-linguistic-feature-extraction-tool/