NPVec1: Word Embeddings for Nepali - Construction and Evaluation
Paper · 2021 · Pravesh Koirala and Nobal B. Niraula
Summary
A Nepali word can appear with several spellings or take endings that mark how it is used in a sentence. When each written variant gets a separate entry, the examples that could help a system learn about the word are spread across those entries. NPVec1 studies whether bringing some of those examples together improves the resulting word embeddings. An embedding represents a word with a vector, an ordered list of numbers learned from patterns in text. After combining online news with Nepali Wikipedia and the OSCAR web collection, the authors discard duplicate sentences and clean up the text that remains. Their base corpus contains 279M word tokens. They prepare alternative versions that vary in how they handle spelling, attached suffixes, and inflected words.
The public release contains 25 sets of representations. The authors train Word2Vec, fastText, and GloVe on each version of the corpus. These methods give a word a fixed representation across its occurrences. They also train a compact Nepali BERT on text with spelling normalization and selected suffixes split off as separate tokens. BERT can give different representations to occurrences of the same word when its surroundings change. The study tests the vectors directly by clustering selected words, then tests their practical value by supplying them to a news classifier with few labeled articles. The classifier’s baseline learns its word representations from those labeled articles alone.
For grouping kitchen and nature vocabulary in the Relatedness Set, Word2Vec, fastText, and GloVe all attain purity of 1, the maximum, when trained on text with normalized spelling and split suffixes. The strongest result on the Sentiment Set comes from GloVe with the same text preparation, at 0.69 purity. Separating positive and negative words is harder across the reported runs. A word and its opposite can fit in much the same sentence, so patterns of neighboring words can link terms that the test asks the clustering procedure to put apart.
News classification favors a different preparation. Word2Vec trained on the base corpus gives the highest test macro F1, at 0.79, compared with 0.69 for the baseline using the base scheme. Macro F1 gives the news categories equal weight when summarizing the balance between finding relevant articles and making correct predictions. The smaller BERT reaches 0.76 test macro F1 with normalized and suffix-split text, tying fastText within that scheme. The best preparation for recovering categories from isolated words and the best preparation for classifying articles are therefore different in these experiments.
Deep dive: NPVec1: Word Embeddings for Nepali - Construction and Evaluation
NPVec1 builds Nepali word embeddings and tests how spelling and suffix choices affect word clustering and news classification. · about 34 minutes to read
The problem and its context
Why text preparation matters for Nepali
A news classifier needs a way to turn the words in an article into inputs it can use. One approach is to design features by hand, deciding in advance which properties of the words or document might help predict its category. The paper motivates learned representations through the time and expertise that this kind of feature engineering requires. Embeddings offer a way to acquire some of those signals before collecting task labels. A system learns from words in ordinary text, and the resulting vectors can then serve as input to a supervised task in natural language processing.
The training signal comes from the company words keep. A representation can preserve information about where a word tends to occur and which other words tend to occur nearby. Even if a labeled article contains a word that appears rarely in the labeled examples, its vector can carry information acquired from the broader corpus. The paper presents this as a route to better generalization when labeled examples are scarce. Acquiring a large, usable body of unlabeled text is a separate challenge. The premise that training can proceed without manual labels still leaves open how much text is available and what the text can teach. This is the connection to distributional semantics.
The authors describe Nepali as the official language and common language of Nepal, with more than 20 million speakers, including communities outside Nepal. The resource constraint concerns the material available for computation. A language can be in widespread use and still have relatively little text that researchers can readily gather in a suitable form. The authors had collected material over several years and combined it with other available collections. Their study treats the resulting corpus as part of the contribution, alongside the trained representations and the tests used to evaluate them. Low-resource languages
There is also a question about the unit a system should learn. An exact written string is easy to count, but there can be several strings associated with what a reader recognizes as the same word. The paper describes written vowel distinctions that can correspond to the same pronunciation, giving rise to alternate spellings. A learner that keeps those spellings separate accumulates evidence for each independently. Combining them changes how much evidence is available for a common entry.
Word structure poses a related question. A noun or pronoun can occur with an ending attached to it, and Nepali verbs can appear in a range of inflected forms. Some endings carry information that can be represented separately. Reducing an inflected word to a base form can also discard distinctions the full form expresses. The study treats those actions differently. Its suffix-splitting rules create additional units in the text, whereas its stemming rules consolidate selected inflected forms. The distinction matters whenever the learner depends on both the identity and position of each unit. Morphology
The resources and approaches already available
The paper describes pretrained embeddings as established resources for languages with abundant training material, giving English and Chinese as examples. It also points to published work for Portuguese, Arabic, and Bengali. The broad opportunity comes from the way most of the methods acquire their training signal. Given enough text, researchers can apply them without first assembling a large collection of manually labeled sentences or documents. The amount, source, and preparation of the text remain consequential even when the training procedure can be reused across languages.
Nepali already had embeddings from a multilingual effort led by Grave and colleagues. That work used Wikipedia and Common Crawl to produce vectors for 157 languages, including Nepali. The paper also discusses Lamsal’s Word2Vec resource trained on news. It contrasts those releases with the coverage of a community repository maintained at the University of Oslo, which the authors describe as hosting 209 pretrained embedding sets at the time, with Nepali absent. The availability of a Nepali download in some collections thus answered only part of the question the authors wanted to pursue. Learning Word Vectors for 157 Languages
The authors characterize the earlier Nepali training collections as smaller and less varied in source than their own. The multilingual vectors drew on Wikipedia and Common Crawl, while the other Nepali resource drew on news. They also describe limited preprocessing in those efforts and say the earlier releases supplied no evaluation of the resulting Nepali representations. NPVec1 is organized around that gap. A researcher needs both a resource to use and some evidence about the conditions under which it supplies useful information. The paper addresses the latter question by preparing several versions of the same collection and evaluating their vectors with shared procedures.
The methods the authors consider come from two families. Word2Vec, fastText, and GloVe produce context-independent vectors. For an entry that has a learned vector, looking it up in different sentences gives the same numbers. Those numbers can reflect evidence pooled over many uses, including different senses of the same form. The word’s immediate surroundings do not select a different vector from the table. This makes fixed vectors straightforward to reuse, while placing the job of handling the local meaning on whatever system consumes them.
With a context-dependent representation, the input sentence contributes to the vector for the current occurrence. The paper describes ELMo as combining information from recurrent processing in both directions and BERT as using a Transformer and attention. Attention allows an internal representation at one position to depend on other positions in the input. The distinction is relevant for a word with several senses: its neighboring words can help determine the representation that the contextual method produces. Deep Contextualized Word Representations
The paper uses an intrinsic and an extrinsic evaluation because each places a different demand on the representation. The intrinsic test inspects the arrangement of vectors by asking whether an automatic grouping resembles categories defined by people. The extrinsic test puts those vectors into a separate task and asks how well the task is performed. The first offers a focused view of the lexical distinctions the vectors happen to support. The second includes the effects of a classifier, its access to labeled data, and the way it combines the input vectors. Each supplies evidence about a different part of the problem.
The method, step by step
Gathering and cleaning the text
The authors draw text from several sources, clean it as a shared collection, and then produce corpus versions with different treatments of spelling and word structure. They train the fixed-vector methods across those versions. The contextual encoder follows a separate training branch on one version, and the outputs of both branches are taken into the two evaluations.
NPVec1 corpus preparation, training, and evaluation
The steps in order.
The authors’ own collection is the largest individual input in their corpus inventory. Over more than a year of crawling Nepali online news outlets, they gathered over 700,000 distinct news articles totaling about 3 GB. The articles span subjects such as technology, politics, society, and sports. The inventory lists 216M tokens and 3.3M types for this source. A token is an occurrence counted at a position in the text. A type is a distinct item in the inventory of forms. A common word can add many tokens while occupying a single entry among the types.
The other news source is a collection obtained from IEEE DataPort, reported at 1.7GB. In the inventory it has 58.8M tokens and 1.2M types. It adds news gathered separately from the authors’ crawl. Independent collection gives the authors another source of material but also creates the possibility of overlap, since more than one collection can capture the same published text. The authors deal with that possibility when preparing the combined corpus.
For broader coverage they use OSCAR and Nepali Wikipedia. OSCAR comes from language identification and filtering of web material collected by Common Crawl. The authors obtain its Nepali portion in a shuffled and deduplicated form, with a size of 1.2GB. Their inventory lists 71.8M tokens and 2.2M types for this source. The Wikipedia contribution comes from Kaggle and comprises 39k articles, occupying 83MB. It accounts for 5.1M tokens and 0.3M types in the inventory. The paper classifies both collections as mixed in genre. Their role is to add contexts beyond those encountered in the news collections.
After pooling the sources, the authors search for repeated sentences. Web collections can share material, and recurring boilerplate can appear even within a collection. The procedure computes a hash for each sentence, using the resulting value as an identifier. A sentence is retained when the identifier is new to the collection being built. The authors report that ∼ 22% of sentences were duplicates and were removed. The pooled check can catch exact repetition between sources even when one of the sources has already undergone its own deduplication.
The next passes remove sentences shorter than 10 characters and strip punctuation. The authors consider the shortest strings of little value as context for learning word vectors. They also map numbers to a common token, NN. That keeps a position indicating the presence of a number while giving the different written quantities a shared representation in the training text. These changes apply before the experiments on Nepali spelling and endings. Consequently the paper’s base, sometimes called raw in the comparisons, is the common cleaned starting point for the optional operations.
Preparing alternative versions of the same corpus
Normalization addresses alternate spellings. The paper uses Nepali written vowels to illustrate how forms that differ on the page can be pronounced alike. The operation maps the variants it identifies to a shared written form. Suppose observations of one spelling tend to be collected under one string and observations of another spelling under another. After normalization, those observations contribute to the same entry. The surrounding words remain evidence about use, while the inventory of spellings under which that evidence is stored changes.
The step called tokenization in the paper deals with certain attached grammatical elements. In this setting it means splitting selected postpositions and agglutinative suffixes from the nouns and pronouns that carry them. A postposition contributes grammatical information following the expression it goes with. An agglutinative suffix is an attached element that adds information to a base and can occur in combination with other elements. The paper illustrates the operation with forms of the word for a Nepalese person. The plural form and a possessive form can both be split to expose the same base, with the respective endings retained in separate positions. Tokenization
This kind of splitting changes several things at once. The base can be seen in contexts that were previously distributed among several whole forms. The isolated ending becomes an item that can occur with many bases. A single written form can also take up more space in the sequence the learning method receives. An ending that was once part of a word can become a neighbor of the base, so even the local contexts that count as training evidence can change. The resulting corpus can have more token occurrences and a smaller inventory of distinct items at the same time.
Stemming is the operation that reduces inflected forms to a base. The authors illustrate it with the verb for eating, whose Nepali forms include those glossed as “ate,” “eating,” and “after eating.” The same base can acquire evidence from the contexts of these forms after stemming. The cost is that an ending’s contribution can disappear from the resulting sequence, whereas the suffix-splitting operation gives selected endings their own positions. NPVec1 uses adapted versions of earlier preprocessing procedures by Koirala and Shakya. Stemming
The corpus names record which operations are applied. B is the base. N denotes normalization, T the suffix-splitting treatment, and S stemming. The simpler variants BN, BT, and BS apply one operation each. BNT combines normalization and splitting, BNS combines normalization and stemming, and BTS combines splitting and stemming. BNTS applies all the operations. Every scheme starts from a version of the same underlying text collection, so the labels track input preparation instead of a choice of source documents.
The count for B is 279M tokens and 3.14M types. BN has 279M tokens and 2.6M types, while BS has 279M tokens and 2.5M types. With both of those operations enabled, BNS has 279M tokens and 2.04M types. In this set of conditions, changing the form assigned to a position makes the type count smaller while the published token count remains the same. Those figures describe the text supplied for training, before any method applies its own requirements for including items in a learned vocabulary.
The counts under T reflect the extra positions created by splitting. BT has 357M tokens and 1.8M types. Combining splitting with stemming in BTS gives 357M tokens and 1.4M types. The BNT variant used for BERT contains 360M tokens and 1.4M types. With all operations enabled, BNTS has 359M tokens and 1.09M types. A larger token count here reflects a change to the units of the existing material. It means the training procedure sees more positions, with much of the additional sequence length arising from separated elements in the same underlying documents.
The assignments also explain how to read the experiments. Comparing B with BN asks what changes when normalization is applied to the base. Comparing BT with BNT asks what happens when normalization is applied in the presence of splitting. These are separate questions because an operation can have different consequences depending on what the other operations have already done to the forms and their contexts. Training the fixed-vector methods on the full set of schemes makes it possible to inspect both questions.
Learning the fixed representations
A fixed-vector run produces a representation that can be retrieved wherever a known form occurs. The authors set the vector dimension to 300 across these runs. This is the number of values in the vector supplied for each represented word. The paper gives 5 as the minimum word frequency and 5 as the window size in its description of the common settings. The frequency setting sets a threshold for counting an item as a vocabulary entry, and the window bounds the local context considered during training. The description also reports a negative sampling size of 5. Negative sampling supplies contrasting examples in the training procedures that use it. The implementations retain their distinct learning mechanisms.
For Word2Vec the authors use Gensim and select skip-gram. The training task uses a focus word to predict neighboring words. If a variant combines two spellings into one, the resulting focus entry can be associated with neighbors previously observed under either spelling. If a variant separates an ending, that ending can become a neighbor and can itself occur as a focus item. The procedure thus responds to changes in the sequence even though its general training objective stays fixed. Word2Vec skip-gram
The fastText runs also use Gensim and skip-gram. The method draws on information carried by pieces within a word, so related forms can contribute evidence through shared internal material. This matters when a particular form is uncommon or absent as a whole vocabulary entry. The available pieces can still supply a representation. It also means fastText has a way of sharing evidence across forms before the corpus is explicitly stemmed or split. Its ability to use pieces and the corpus rules’ ability to expose a common base are distinct changes to the pipeline. fastText subword representations
GloVe is trained with the StanfordNLP tool. It uses word co-occurrences, observations of which items appear near each other in the corpus. Changing a word boundary or merging written forms affects the counts available to this method as well. The paper’s comparison keeps the basic settings aligned where applicable while comparing different ways of learning from these observations. It reports 24 fixed-vector embedding sets across the corpus schemes. Identifying a set therefore requires both the learning method and the corpus code. A GloVe result under BNT, for example, describes vectors trained with a different inventory of units from GloVe under B.
Training the contextual encoder
The authors choose BNT for BERT because the fixed-vector runs under that preparation performed strongly on the intrinsic tests. They train the contextual encoder with Hugging Face’s Transformers library. Computing constraints lead them to use this preparation for the only BERT run and to make the encoder smaller than the BERT-base configuration discussed in the paper. Thus the contextual comparisons have a shared preprocessing condition, while the study of how preprocessing affects a given learning method is confined to the fixed-vector families. Hugging Face Transformers
The Nepali implementation has 6 hidden layers and 6 attention heads, with a hidden dimension of 300. A hidden layer transforms the internal representation of the input. Attention heads give a layer multiple ways to weigh information from positions in the sequence, and the hidden dimension gives the width of the internal representation. The BERT-base configuration used for comparison has 12 hidden layers, 12 attention heads, and a width of 768. The authors report 22.5M adjustable parameters for their implementation and 110M for BERT-base.
The maximum input sequence size is 512, and the WordPiece vocabulary limit is 30,000. WordPiece can express a text form using smaller units from the vocabulary. The suffix-splitting rules produce BNT before the encoder processes it. WordPiece then determines which units the encoder actually reads. A Nepali grammatical ending separated during corpus preparation and a smaller unit chosen by WordPiece can therefore arise through different parts of the process. The corpus type counts and the WordPiece vocabulary limit describe different inventories. Subword tokenization
The training objective is masked language modeling. Some units in the input are hidden, and the encoder learns to recover them using information available in the sequence. The authors train for a single epoch, a pass through the training data. The original BERT procedure described in the paper also uses next sentence prediction, which supplies a training objective concerning pairs of sentences. The Nepali implementation uses the masking objective alone. The encoder’s depth, width, attention configuration, and training procedure are all part of the specific contextual resource that the authors evaluate.
Obtaining vectors and evaluating them
The algorithms downstream of pretraining need vectors in a usable form. For Word2Vec and GloVe, a known word is represented by its learned entry. An out-of-vocabulary form is one for which that lookup has no entry. The paper points out that fastText and BERT can represent such forms and describes averaging the corresponding vectors when forming a representation for them. It gives no item-by-item account of which probe words required this treatment. For BERT, the general extraction procedure averages the hidden states from the final two layers. A hidden state is the internal vector produced at a position by a layer.
For clustering, the authors feed words to BERT in isolation. This creates a vector for an individual item that can be handed to the same grouping procedure used for the fixed vectors. K-means assigns vectors to groups using their positions and the centers of the groups. The number of groups is specified in advance. The paper uses the following setting on each word list.
K = 2
K is the number of clusters requested, = sets that number, and 2 is the number of reference categories in either list. Each word’s reference label is used when scoring the resulting assignment. The clustering itself operates on the vectors. The Relatedness Set supplies kitchen and nature labels for scoring, and the Sentiment Set supplies positive and negative labels.
The score is purity. For each cluster, the most frequent reference label determines which of its items count toward purity. The score summarizes the share of items accounted for by those dominant labels across the clusters. The paper gives the range as 0 to 1, with 1 denoting a perfectly pure clustering. Group identities can be assigned after clustering, so a group has no requirement to emerge under a particular category name. The measurement concerns how consistently members of a group share the reference label.
For the news experiment, the authors use a feed-forward classifier implemented in Keras. They take the first five hundred tokens of an article and obtain their vectors. The contextual vectors are again drawn from the last two hidden layers. An averaging layer pools the token vectors, producing an article representation whose entries are the averages of the corresponding entries across inputs. For fixed vectors, this portion of the pipeline turns a sequence of lookups into a summary of the words in the selected article prefix. Any contextual relationships BERT has encoded in its outputs can affect the average through those outputs.
The pooled vector is fed to a hidden layer with 64 units and a ReLU activation, which preserves positive values and maps negative ones to zero. The output has 10 units with sigmoid activations, giving each category its own score. The authors train with binary crossentropy, a loss that compares predicted scores with target labels, and run training for 60 epochs per setting. They use Adam to update the trainable parameters as the classifier learns. Adam
The baseline uses a trainable Keras embedding layer in front of the same pooling and classification architecture. Its vectors are learned from the available labeled news examples. This setup gives the baseline a way to acquire useful representations for the task itself. The comparison therefore asks whether supplying representations acquired from the larger unlabeled corpus improves the same kind of decision when labeled news is scarce. The experiment addresses this question through text classification.
Experiments and results
What the word lists measure
Analogy tests are one approach to assessing the organization of word vectors. They ask whether a relationship expressed by one pair can help identify a member of another pair. The authors say an analogy dataset for Nepali was unavailable for their study. They follow a clustering approach previously used for Arabic and construct two sets of words by hand. In this design, the evaluator knows which category each word belongs to, and the experiment asks whether groups derived from the vectors reproduce those assignments.
The Relatedness Set has twenty one examples for each of its topics. Kitchen terms include sugar, salt, and a pot. Nature terms include words for a mountain, a hill, and a river. Words in one group can stand for different kinds of things while belonging to a setting where they are likely to be discussed together. A pot and salt can both appear in descriptions of preparing food even though one is a vessel and the other an ingredient. This is the kind of association that the paper expects evidence from shared contexts to capture.
The authors describe the Sentiment Set as containing nineteen examples per polarity. They include positive terms such as “good,” “big,” and “justice” alongside terms on the negative side such as “bad,” “small,” and “injustice.” The test uses the polarity assigned in the word list. Its connection to semantic similarity comes through the difference between belonging to the same general area of meaning and being close in the particular meaning a benchmark wants to recover. Antonyms can describe the same property and be used with the same nouns. A representation that captures that common use may bring the words together even though the reference labels demand separation.
The lists therefore place different demands on the arrangement of the learned vectors. Relatedness asks whether the space produces coherent groups for broad subject areas. Sentiment asks it to recover a distinction that can run across contexts that otherwise look similar. The authors report higher Relatedness purity than Sentiment purity for every embedding run in their results. That consistent ordering is visible across corpus treatments and extends to the context-dependent run. The two inventories, and the input produced from each item, define the scope of the comparison.
Recovering topical groups
Under BNT, Word2Vec, fastText, and GloVe each obtain Relatedness purity of 1. The result means that the groups for this list were perfectly homogeneous by the reference labels. The corresponding BERT result is 0.83. This compares representations derived from the same text preparation under the same evaluation protocol. The method for producing the actual test input differs: the fixed-vector methods return fixed representations, whereas BERT processes each probe word as an isolated input.
Several runs also reach the ceiling without the combined preparation. For the base corpus, fastText obtains 1, Word2Vec obtains 0.98, and GloVe obtains 0.95 on the Relatedness Set. Under normalization alone in BN, both Word2Vec and fastText reach 1, with GloVe at 0.98. With splitting alone in BT, GloVe reaches 1 and both Word2Vec and fastText record 0.98. BNT is the condition in which the ceiling result is shared by all the fixed-vector families. Other schemes already give individual methods enough separation for perfect purity on these topics.
The scores also help explain the paper’s interest in the lexical representations as resources beyond the immediate tests. Words in the topical groups can be associated without being interchangeable, and the vectors are consistent enough for K-means to recover those broad associations. At a score of 1, the test has exhausted its ability to distinguish how well different runs recover these particular reference groups. Finer differences in distances within a group, or the placement of another category in the same space, would require evidence beyond these scores.
Separating positive and negative vocabulary
The highest sentiment purity, 0.69, comes from GloVe under BNT. In the same condition BERT follows at 0.59, with Word2Vec at 0.54 and fastText at 0.51. BERT’s relative position thus changes across the two word lists. It is below the fixed-vector runs on Relatedness under BNT and above Word2Vec and fastText on Sentiment. In absolute terms each of the methods in this comparison records higher purity on the topical list than on the polarity list.
Sentiment Set purity with normalization and suffix splitting
GloVe produces the purest polarity groups, with BERT next.
The numbers
| System or setting | Purity |
|---|---|
| Word2Vec | 0.54 |
| fastText | 0.51 |
| GloVe (this paper) | 0.69 |
| BERT | 0.59 |
GloVe’s advantage on the sentiment list extends across much of the fixed-vector comparison. Its purity is 0.67 under both B and BT, 0.62 under BN, and 0.64 under BNS. The BNTS run is an exception to the ordering typically seen: GloVe and Word2Vec both reach 0.51, and fastText reaches 0.54. GloVe’s leading result consequently belongs to a particular combination of learning method and preparation. The vectors trained with the same method after adding stemming to BNT give a different outcome on the same items.
The authors explain the general difficulty of the sentiment test through the surrounding text. An adjective meaning “new” and one meaning “old” can both describe the same object in otherwise similar sentences. Neighboring words provide evidence for their shared topic and grammatical role, as well as whatever distinctions can be inferred from use. Clustering then makes a single grouping decision from the resulting vector for each item. GloVe’s stronger performance supports a claim about the separability of these probe words in its vector space. The paper suggests relevance for sentiment analysis, which would need a downstream test of its own.
How the news test was set up
The extrinsic test draws on the public Nepali News Dataset. The source contains 10 news categories with 1000 articles each. The authors select 3000 articles with 300 examples from each category. They then make a random split using proportions of 10% for training, 10% for validation, and 80% for testing. The resulting partitions contain 313 training examples, 326 validation examples, and 2361 test examples. The training set has at least 21 articles per class and the test set has at least 227 per class.
The small training partition creates the situation the authors want to measure. The classifier has relatively few examples from which to infer which words and patterns distinguish the categories. A pretrained vector can supply distributional information accumulated from the much larger corpus. A trainable baseline vector must acquire its usefulness from the news training examples. The larger test partition gives the authors more examples on which to assess generalization while leaving the number of labeled examples used to learn the classifier deliberately small.
The reported measures are macro precision, macro recall, and macro F1. For a category, precision concerns the proportion of assigned articles that belong to it, and recall concerns the proportion of its articles that were successfully assigned to it. F1 combines those two aspects of performance. Macro scoring gives all categories equal influence in the aggregate. A gain in macro recall indicates better recovery averaged across categories, while macro precision concerns how reliably those predictions correspond to the reference categories. The paper reports the aggregate test measures without a breakdown by category.
A baseline is reported for each preprocessing scheme. This matters because the choice of units can help or hinder the classifier’s own embedding layer just as it changes the input to a pretrained run. Within a scheme, the baseline gives a reference for learning word representations from the labeled examples under that treatment of the text. Across schemes, comparing the best runs answers a different question about which whole setup works best in the experiment. The results include cases where these two ways of reading the table lead to different emphases.
Gains from pretraining on the news task
The highest test macro F1 in the paper is 0.79 for Word2Vec in the base scheme. The B baseline reaches 0.69. Word2Vec’s test macro precision is 0.80 and its macro recall is 0.79, compared with 0.76 precision and 0.68 recall for the baseline. Both measured aspects of test performance favor the Word2Vec run in that setting. The other pretrained options in B also exceed the baseline in macro F1, with fastText at 0.78 and GloVe at 0.77.
Nepali News Dataset test macro F1 in the base scheme
All pretrained options outperform the baseline, led by Word2Vec.
The numbers
| System or setting | Macro F1 |
|---|---|
| Trainable embedding baseline | 0.69 |
| Word2Vec (this paper) | 0.79 |
| fastText | 0.78 |
| GloVe | 0.77 |
Across the classification experiments, the authors describe the pretrained runs as exceeding baseline F1 by 5 percent on average. The scheme-level comparisons show where the advantage is smaller or the ordering changes. In BNT, the baseline obtains 0.73 test macro F1, Word2Vec obtains 0.74, and GloVe obtains 0.75. In BTS, GloVe reaches 0.73 and the corresponding baseline reaches 0.74. The general benefit of pretrained vectors in this experiment includes variation with the choice of preprocessing and representation.
BERT’s result belongs to the BNT comparison. It records 0.76 test macro F1, with 0.77 macro precision and 0.76 macro recall. fastText also records 0.76 macro F1 under BNT; its precision is 0.78 and its recall is 0.76. This places the contextual run among the strongest in the scheme available to it. The highest score in the broader news experiment remains the base Word2Vec result. Since BERT was trained only under BNT, the news table supplies no comparable BERT run under the base preparation.
The relationship between the intrinsic and extrinsic scores is especially clear when the GloVe runs under B and BNT are considered together. BNT gives the higher purity for both word lists, reaching 1 on Relatedness and 0.69 on Sentiment, while B scores 0.95 and 0.67 on those respective lists. On the news test, B gives GloVe a macro F1 of 0.77 and BNT gives it 0.75. The clustering and classification procedures read different properties of the vectors. A classifier using the average of many token vectors can benefit from a representation that is less successful at separating a particular list of isolated words.
What the ablations show
Normalization depends on the input and the test
The paper’s principal controlled comparisons are the corpus variants. For a fixed learning method, a pair of runs can share the settings for splitting and stemming while differing in spelling normalization. The comparison then measures the effect of enabling normalization as a corpus operation, including any change in which entries are common enough to learn and what contexts they pool. The scores do not separately test each spelling rule. They show the behavior of the full treatment within a particular combination.
On the Relatedness Set, changing from B to BN moves Word2Vec from 0.98 to 1 and GloVe from 0.95 to 0.98, while fastText is at 1 in both. Holding splitting on and comparing BT with BNT also gives a favorable pattern for topical clustering. Word2Vec and fastText each record 0.98 with splitting alone and 1 with normalization added. GloVe is already at 1 under splitting alone. These comparisons are compatible with the idea that combining spelling variants gives a clearer estimate of which words share topical contexts.
The polarity list shows why that account has to stay tied to the task. When normalization alone is added to the base, Word2Vec’s Sentiment purity rises from 0.54 in B to 0.56 in BN, while GloVe’s moves from 0.67 to 0.62. The effect can also depend on the presence of splitting. Adding normalization to BT gives GloVe 0.69 under BNT compared with 0.67 under BT, whereas fastText obtains 0.51 under BNT compared with 0.54 under BT. Pooling contexts for alternate spellings can change the geometry without consistently sharpening the distinction between the reference polarities.
The authors see little overall benefit from normalization for news classification. Within the base and normalized-only comparison, the test macro F1 for fastText is 0.78 in each scheme, and the GloVe score is 0.77 in each. Word2Vec, the strongest entry under B, records 0.79 there and 0.78 under BN. The corresponding baseline moves from 0.69 to 0.72. The authors suggest that their professional news sources have relatively consistent spelling and that normalization could be more valuable for less standardized material. The difference between the baseline and pretrained patterns also shows that the downstream learner’s starting point matters.
Splitting affects what the classifier averages
Sufficiently common attached endings can become common standalone tokens after splitting. That is a way of sharing evidence about bases, since occurrences previously counted under several attached forms can now contribute to a single base. It also changes the content of the classifier’s averaging layer. With the same rule applied throughout an article, the separated endings now contribute entries to the pooled representation. If the first five hundred tokens are used, the expanded sequence can also change how far into an article that prefix reaches. The impact of splitting can therefore reflect changes both to learned vectors and to the inputs presented to the classifier.
A comparison of B with BT illustrates why the authors distinguish effects on the baseline and on pretraining. The baseline rises from 0.69 test macro F1 in B to 0.72 in BT. Word2Vec goes from 0.79 to 0.77 and fastText goes from 0.78 to 0.76, while GloVe records 0.77 in both. The pattern recurs with normalization enabled: the labeled-only baseline has 0.72 macro F1 in BN and 0.73 in BNT, while each of the pretrained fixed-vector runs has a lower score under BNT than under BN. In these comparisons, a change that helps the labeled-only run can give the pretrained classifier a less effective input.
The paper suggests that some frequent grammatical markers might acquire associations with particular topics in training. When these markers are split off, their representations have repeated opportunities to affect a document average. The authors propose trying the removal of postpositions and other frequent forms for classification. Their scores measure the full effect of splitting, which changes the representations of the bases and the presence of the endings together. A comparison that removed the markers after splitting would be needed to estimate the contribution of those tokens to the classifier’s decision.
Stemming gives its clearest losses on topical clustering
The most consistent result for stemming comes from the Relatedness Set. With stemming added to the base, the BS runs for Word2Vec, fastText, and GloVe each obtain 0.93. For every family, the corresponding B run has higher Relatedness purity. Similarly, adding stemming to BNT gives the BNTS results of 0.95 for all the fixed-vector runs, compared with 1 for those same methods under BNT. These comparisons support the paper’s concern that the version of stemming it used can make topical groups harder to recover.
The authors’ proposed explanation is over-stemming, where a rule maps forms to the same base even though their differences would be useful to the learner. A shared form then gathers contexts that may have supported a distinction before the merge. The polarity scores illustrate how dependent the outcome is on the conditions. From BNT to BNTS, GloVe’s Sentiment purity goes from 0.69 to 0.51 and Word2Vec’s goes from 0.54 to 0.51. For fastText it goes from 0.51 to 0.54. The general concern about stemming is clearest in the repeated Relatedness losses, while the Sentiment scores give each family a different response.
In news classification the direction can also change. GloVe gets 0.75 test macro F1 in BNT and 0.77 in BNTS, even as its ability to separate the polarity list weakens. fastText has test macro F1 of 0.76 in both schemes. The paper reports the spread across all preprocessing schemes as a standard deviation of 2.4% for the Word2Vec classification F-scores, 1% for fastText, and 1.4% for GloVe. Standard deviation summarizes how dispersed the reported scores are. The fastText result indicates the least dispersion over those schemes, which include changes to spelling and splitting as well as stemming.
The authors interpret that stability as a reason to consider fastText when an application needs a stemmer. Its use of material internal to words offers a possible route to tolerating imperfect treatment of complete forms. The standard deviations summarize all the scheme changes, so they establish relative stability under the tested set of operations. The study leaves open how much of that stability is specifically a response to stemming and what would happen with a different stemmer. The suggestion that over-stemming causes the losses remains a hypothesis about why the observed differences arise.
What can be compared for BERT
The comparison within BNT controls for the chosen corpus preparation. Under that condition, the contextual encoder ties fastText’s test macro F1 on news, trails the fixed-vector methods in recovering the topical groups, and places between GloVe and the other fixed-vector runs on sentiment. These measurements describe the encoder together with the way its representations were extracted. In particular, the lexical probe gives it a word in isolation, and the news classifier uses averages derived from the encoder’s token representations.
The paper supplies a single contextual configuration, with its architecture, training duration, objective, and input scheme bundled together. There is consequently no controlled comparison of those choices within BERT. Similarly, comparing the reduced architecture with the original configuration on paper establishes their sizes and training differences. Estimating the effect of greater depth or of more training would take an actual run with the relevant change. The authors’ expectation of better performance with additional resources is a direction for further evaluation.
Limitations
Limits identified by the authors
The authors explicitly connect the scope of the BERT experiment to computing constraints. They use a reduced encoder, train it for a single epoch, and select just the normalized and suffix-split corpus. They also place the quantity of text in perspective by comparing their 360 million words with 3.3 billion words for the original BERT training. Gathering enough Nepali material for a larger run is itself part of the resource problem. The authors propose training with the original architecture, more text, and additional epochs. These proposals leave the measured news and clustering results specific to the smaller run.
They also identify room to improve the stemmer. The paper suggests comparing against stemming rules that make fewer over-stemming errors. That would help establish whether the purity declines reflect particular incorrect merges or a broader cost of reducing certain word forms before training. The existing runs supply evidence about the procedure the authors used. The study gives no measured stemming error rate that would connect individual errors with the items crossing cluster boundaries.
A further constraint was the absence of a Nepali analogy dataset for the intrinsic evaluation. The authors responded by constructing word lists that test topical association and polarity. They also propose further applications in named entity recognition and part-of-speech tagging. Those tasks attach labels to spans or tokens in running text, so strong grouping among isolated related words gives a reason to investigate them. The paper’s supervised measurements concern news articles, leaving the suggested sequence-labeling results open.
The authors expect that normalization could matter more for tweets, blogs, and other less standardized writing than it does for their news classification task. Their account links that expectation to a greater opportunity for spelling variation. Similarly, they discuss other contextual approaches as future comparisons, including XLNet and RoBERTa. These ideas describe extensions of the evaluation beyond the reported text and encoder. XLNet · RoBERTa
Limits of the evidence in the setup
The Relatedness Set has broad and recognizable categories. It can show that learned vectors recover kitchen and nature as groups, while leaving open whether the same vectors distinguish closely related categories or organize terms appropriately within each group. Several runs reach purity of 1, so their scores offer no ranking among those runs for this inventory. The Sentiment Set gives a harder test, but its labels still express a handpicked polarity distinction among isolated words. It cannot establish how well a representation captures all the similarities people perceive, or how the same information would be used in judging the sentiment of a passage.
Vocabulary coverage is another part of what the clustering scores can reflect. The methods differ in their ability to derive vectors for a form missing as a whole entry, and the paper describes averaging where it uses corresponding vectors for such forms. The results do not break out which items are represented by direct lookup, how many need another treatment, or how well those subsets cluster. A gap in purity can therefore contain contributions from coverage as well as from the relative positions of the vectors. The aggregate score describes the procedure as applied to the list.
The isolated input limits the test of context dependence. An encoder can, in principle, give different representations to occurrences of a word with different senses. Here the word arrives without a sentence, so the clustering experiment cannot test whether those occurrences would be distinguished appropriately. News provides longer input, but the classifier receives a pooled vector instead of the separate outputs at every position. What can reach the category decision is mediated by that average. A task that explicitly examines representations for target words in multiple sentence contexts would measure a different capability.
The classification numbers describe the reported split, the limited supply of labeled examples, and an architecture that uses an article prefix. The paper gives each run’s aggregate test scores and a measure of variation across the preprocessing schemes for the fixed-vector families. It supplies no estimates from drawing new labeled splits or repeating training in a fixed condition. The reported rankings identify the strongest observed configurations. The reproducibility of close differences, and their behavior as the amount of labeled data grows, remains unmeasured.
The source mixture also shapes what can be concluded. News contributes heavily to pretraining, and the applied evaluation is itself on news. The authors describe checking for duplicate sentences within the assembled corpus. They give no measurement of overlap between that corpus and the downstream dataset, so the degree of shared material is unknown. They also do not compare parallel training runs on the component sources individually. The results establish the behavior of representations learned from the assembled text. They leave the added value of each source, including the mixed-genre material, unresolved.
Finally, the historical comparison and the experimental comparison answer separate questions. The authors describe NPVec1 as a larger and more varied Nepali resource than the earlier efforts they discuss. The experiment compares its own trained variants and the labeled-only classifier under common evaluations. Head-to-head scores for the earlier Nepali embeddings are absent, so the study establishes the scale and range of the new resource and measures differences within it. Its strongest evidence about preparation comes from matched runs where the learner and evaluation are shared and a corpus operation changes.
What came after
A later citing work turns to the problem of finding names and other entities in Nepali text. Its stated scope covers datasets and algorithms for that task. This is one of the applications the NPVec1 authors identify as worth exploring. It calls for evidence about decisions on spans in running text, whereas NPVec1’s applied experiment concerns the category of an entire news article. The citation establishes the connection to NPVec1. Which embedding set, if any, was used by the later algorithms and how it performed are unspecified. Named Entity Recognition for Nepali
Another citing work examines Nepali lemmatization with multilingual Transformers in a low-resource setting. Lemmatization seeks the conventional base entry associated with a word form. In NPVec1, reducing inflected forms is an input treatment whose effects are evaluated on other tasks. In the later work, the base-form analysis is itself the object of study. The title also identifies intrinsic and extrinsic evaluation, carrying the distinction between examining a resource directly and measuring it in an application into a study centered on word forms. The citation and stated scope establish those connections. They leave the later work’s use of particular NPVec1 vectors or corpus variants unspecified. Nepali Lemmatization with Multilingual Transformers
Cite
Cite as Pravesh Koirala and Nobal B. Niraula. 2021. NPVec1: Word Embeddings for Nepali - Construction and Evaluation. Proceedings of the 6th Workshop on Representation Learning for NLP (RepL4NLP-2021).
@inproceedings{koirala2021npvec1,
title = {{NPVec1: Word Embeddings for Nepali - Construction and Evaluation}},
author = {Pravesh Koirala and Nobal B. Niraula},
booktitle = {Proceedings of the 6th Workshop on Representation Learning for NLP (RepL4NLP-2021)},
year = {2021},
doi = {10.18653/v1/2021.repl4nlp-1.18},
url = {https://doi.org/10.18653/v1/2021.repl4nlp-1.18}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/koirala-2021-npvec1-word-embeddings-nepali-construction/