Next Article in Journal
Trustworthy AI Guidelines in Biomedical Decision-Making Applications: A Scoping Review
Previous Article in Journal
ReJOOSp: Reinforcement Learning for Join Order Optimization in SPARQL
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Semantic Non-Negative Matrix Factorization for Term Extraction

1
Big Data and Blockchain Technologies Research Innovation Center, Astana IT University, Astana 010000, Kazakhstan
2
Laboratory of Digital Technologies and Modeling, Sarsen Amanzholov East Kazakhstan University, Ust-Kamenogorsk 070000, Kazakhstan
*
Author to whom correspondence should be addressed.
Big Data Cogn. Comput. 2024, 8(7), 72; https://doi.org/10.3390/bdcc8070072
Submission received: 16 May 2024 / Revised: 19 June 2024 / Accepted: 24 June 2024 / Published: 27 June 2024

Abstract

:
This study introduces an unsupervised term extraction approach that combines non-negative matrix factorization (NMF) with word embeddings. Inspired by a pioneering semantic NMF method that employs regularization to jointly optimize document–word and word–word matrix factorizations for document clustering, we adapt this strategy for term extraction. Typically, a word–word matrix representing semantic relationships between words is constructed using cosine similarities between word embeddings. However, it has been established that transformer encoder embeddings tend to reside within a narrow cone, leading to consistently high cosine similarities between words. To address this issue, we replace the conventional word–word matrix with a word–seed submatrix, restricting columns to ‘domain seeds’—specific words that encapsulate the essential semantic features of the domain. Therefore, we propose a modified NMF framework that jointly factorizes the document–word and word–seed matrices, producing more precise encoding vectors for words, which we utilize to extract high-relevancy topic-related terms. Our modification significantly improves term extraction effectiveness, marking the first implementation of semantically enhanced NMF, designed specifically for the task of term extraction. Comparative experiments demonstrate that our method outperforms both traditional NMF and advanced transformer-based methods such as KeyBERT and BERTopic. To support further research and application, we compile and manually annotate two new datasets, each containing 1000 sentences, from the ‘Geography and History’ and ‘National Heroes’ domains. These datasets are useful for both term extraction and document classification tasks. All related code and datasets are freely available.

1. Introduction

Computational terminology encompasses a variety of methods aimed at the automatic extraction of stable lexical units from a given communicative context [1]. Depending on the form in which the context is presented, either as a corpus of domain text or a single document, two popular tasks are distinguished in computational terminology: term extraction and keyword extraction. Term extraction involves identifying words that consistently appear across a corpus of documents and which are specific to a domain, reflecting the specialized language and concepts of that domain. Keyword extraction focuses on identifying words that best describe the content of a single document and highlight its key information. Therefore, the primary difference between these tasks is determined by the fact that keywords are attributes of the text, while terms are attributes of the domain [1]. This generates a difference in terms of understanding the relevance of extracted lexical units.
According to the authors [2], the relevance of terms, as opposed to keywords, should be measured within the conceptual structure of the domain, not within the corpus. This perspective emphasizes the primary significant challenge of automatic term extraction, described by the authors of [2] as “the issue of coherence of terms as a set”, also known as the “apple-orange-banana” issue. Interpreting this issue, if the term “apple” is recognized within a text corpus, semantically close terms like “orange”, “banana”, and even “durian” should also be extracted, regardless of how frequently these words appear in the corpus [2]. This issue clearly underscores the need to reach beyond the corpus for term extraction, requiring the utilization of external knowledge bases. Word embedding represents one of the compact and contemporary methods for capturing domain knowledge. Hence, our primary goal lies in leveraging word embeddings to expand the semantic scope of the corpus and provide the most relevant depiction of the domain.
On the flip side of the coin, the issue of “coherence of terms as a set” is mirrored by the issue of “generalization across domains”. Both issues are two sides of the same problem, relating to how domain knowledge should be organized, which is a fundamental aspect of cognition, learning, and artificial intelligence. The concept of “coherence of terms as a set” focuses on the internal consistency and logical arrangement of terms/concepts within a domain. This ensures that the terms/concepts grouped together under a category share common defining characteristics that make the group meaningful. Conversely, “generalization across domains” concerns the application of these coherent groups of terms/concepts to new and varied domains. This involves abstracting knowledge from one context and adapting it to others, testing the boundaries of how far the underlying principles of a category can be applied. Together, these sides address both the depth and breadth of knowledge organization.
Generalization across domains is the vulnerable point of most modern knowledge discovery frameworks based on transformer models [3]. Transformers, which are state of the art in deep learning, achieve top performances in many natural language processing (NLP) tasks, including both language understanding and language generation (e.g., BERT, GPT-4, LLaMA etc.). In the context of term extraction, NLP techniques are employed to identify and extract relevant lexical units from text data, thereby facilitating better knowledge discovery and engineering. However, the performance of transformers dramatically drops when they are applied to a new communicative context—whether a new domain or language. In such cases, they must re-learn or undergo fine-tuning using new data from the new domain or language. For high-tech domains, the primary targets of most commercial knowledge discovery platforms, annotating training data is expensive due to the need for highly specialized experts [3]. Despite the recent emergence of promising transfer learning studies, offering hope for generalizing supervised approaches [4,5,6,7,8], there is still room for improvement in supervised term extraction and broader knowledge discovery tasks.
Unlike their supervised counterparts, unsupervised term extraction methods do not require training data and are less affected by domain shifts. However, given this invariance to the domain, unsupervised methods usually exhibit lower performance [9]. This sets the stage for our efforts. While our primary motivation is to enhance the semantic understanding of the domain using word embeddings, incorporating semantics can also improve the performance of unsupervised methods, specifically, the non-negative matrix factorization (NMF) approach, the enhancement of which is our secondary, yet equally critical, motivation. The standard NMF framework for topic modeling focuses on factorizing a sparse document–word matrix, which represents the distribution of words across documents, into two matrices: document–topic and topic–word. The document–topic matrix is typically used to cluster documents by topics, while the topic–word matrix is employed to extract the most valuable words from these topics. The hypothesis is that incorporating semantics, encoded by word embeddings, can mitigate the effects of sparsity in the document–word matrix and enhance the effectiveness of both document clustering and term extraction.
The authors of [10] were the first to propose such an integration, suggesting the use of semantic NMF to enhance document clustering. Their method, both elegant and powerful, involves the joint factorization of the sparse document–word matrix and the semantically rich word–word matrix derived from word embeddings into two distinct products, sharing a common topic–word factor. This approach draws semantically related words closer in the latent topic space, enhancing the representation of document–topic relationships and thereby improving document clustering. Inspired by their novel, theoretically grounded algorithm—an extension of the widely recognized NMF by Lee and Seung [11]—we adapted it for term extraction.
To the best of our knowledge, while some studies have applied semantically enriched NMF for document clustering, we are the first to utilize it for term extraction. We attribute this to the fact that the solution to document clustering is typically sought in a lower-dimensional space compared to that of term extraction. Typically, the word–word matrix, representing semantic relationships between words, is constructed using cosine similarities between word embeddings. However, it has been established that embeddings from transformer encoders tend to reside within a narrow cone, leading to consistently high cosine similarities between words [12]. This phenomenon can limit the power of the word–word matrix in distinguishing between domain terms and those that are merely co-located within the same dense area. While this does not negatively impact the effectiveness of semantic NMF for document clustering, it is crucial for term extraction. To address this issue, we substitute the word–word matrix with a word–seed submatrix, limiting its columns to ‘domain seeds’—specific words that capture the core semantic characteristics of the domain.
We compared our approach with traditional NMF [9] and the recent, but already popular, transformer-based methods KeyBERT and BERTopic [13,14]. The results demonstrated the significant superiority of semantic NMF across two related datasets from the Geography & History and National Heroes domains, which were generated using GPT-4 and subsequently manually checked and annotated. Therefore, the main contributions of our study are as follows.
  • Novel semantic NMF method for term extraction: We introduced a novel unsupervised method for automatic term extraction that utilizes the semantic NMF algorithm.
  • Novel construction of the word–word matrix using seed words: We proposed a novel way to construct the word–word matrix, a cornerstone of semantic NMF, by introducing the concept of domain seeds. In fact, we replaced the word–word matrix with a word–seed submatrix.
  • Development of annotated datasets: We generated two datasets, each consisting of 1000 sentences from the Geography & History and National Heroes domains, and manually annotated them for both term extraction and document clustering/classification tasks. We made these datasets freely available.

2. Related Work

NMF is not commonly used for term extraction, although it generates two important matrices: the document–topic matrix, which shows how documents are distributed across topics, and the topic–word matrix, which shows how words are distributed across topics. When examining topics as deeper explorations of the domain, the words with the highest weights within each topic are usually key to understanding that domain. By focusing on these heavily weighted words, NMF can effectively highlight the essential terms of the domain. However, the most vulnerable aspect of this concept is data sparsity, which results in the underrepresentation of infrequently used terms that, despite their importance to the domain, receive less emphasis in topic representations. Semantic NMF enhances the traditional NMF approach by integrating semantic information, which improves text analysis capabilities and mitigates data sparsity. While numerous studies in this field exist, they predominantly focus on document clustering.
One pioneering study in this field introduces a semi-supervised NMF (SSNMF) that performs joint factorization of data and label matrices, using a shared factor matrix to ensure consistency [15]. A vector of class labels is converted into a binary matrix, where ‘1‘ appears in each row, but only at the position corresponding to a specific class, with all other items in the row set to ‘0‘. Additionally, binary weights are employed to manage cases where class labels are unknown or when data entries in the data matrix are missing. The experimental results demonstrate that semi-supervised NMF enhances classification performance by incorporating labeled data samples. A two-step semi-supervised semantic NMF approach is introduced in [16]. The first step involves extracting interpretable topics from labeled data, and the second step uses these topics to guide the refinement of final bases into semantically interpretable forms. This semantic NMF approach also outperforms conventional NMF.
The highly effective semantic NMF (SeNMFk) approach is detailed in [17,18]. SeNMFk conducts joint factorization of the document–word matrix using the TF-IDF metric and the word–context matrix, utilizing Kullback–Leibler divergence. Moreover, the determination of the number of latent factors, k, is based on custom resampling rather than an empirical approach. The authors of [19] expand SeNMFk with a focus on large datasets. Their novel distributed approach, named SeNMFk-SPLIT, enables the joint factorization of large documents by separately decomposing the word–context and term–document matrices. The previously mentioned work [10], which served as our source of inspiration for this study, also falls into the same category of research [17,18,19] that connects standard NMF with the semantics hidden in dense or distributional encodings of words.
An interesting empirical approach is combined with semantic NMF in [20]. To encourage certain ‘important’ words from the corpus vocabulary to play a larger role in factorization, the rows corresponding to these words in the word–document matrix are directly multiplied by a large constant coefficient. Combining the highlighting of keywords with semantic NMF allows for the formation of significant topics that align with desired prior keywords. In [21], keywords provided under user supervision, which are referred to as seed words, and groups of these words, which are known as seed topics, are utilized. Guided NMF (GNMF) is formulated as the joint regularization of the data matrix and a seed matrix, which is constructed from these seed topics. The authors of [22] extend the semi-supervised and guided semantic NMF approaches by introducing guided semi-supervised semantic NMF (GSSNMF), which incorporates both label information and seed words. Compared to SSNMF, GSSNMF more accurately classifies documents, and it generates more coherent topics relative to GNMF.
The word–word matrix, representing semantic relationships among words, can be directly factored using symmetric NMF techniques [23], without the need for joint factorization with the document–word matrix. Symmetric NMF factors a pairwise similarity matrix into the products of a non-negative matrix and its transposed matrix, thereby extending standard NMF from an inherently dimensional reduction technique to a general clustering method. In [24], a semi-supervised symmetric NMF model is proposed, capable of simultaneously learning the similarity matrix with supervisory information in the form of pairwise ML (must link) and CL (cannot link) constraints, and of generating higher-quality clusters. The idea of ML and CL constraints is also used in [25], albeit with different penalty strategies. ML constraints are employed to control the distance of the data in the basis matrix, while CL constraints regulate the encoding vector matrix. In both studies [24,25], symmetric NMF, enhanced with supervisory information in the form of ML and CL constraints, demonstrates a superior quality of clustering.
A multistep approach to semantic topic modeling is used in [26]. This study enhances traditional NMF by incorporating semantic text representation using word sense disambiguation and lexical semantic similarity measures. The model refines the term–topic matrix through semantic low-pass filtering and tag edge detection to improve topic coherence and stability. The final topic–document matrix is constructed by integrating the refined term–topic matrix with the document–term matrix.
As the review of related work indicates, semantic NMF captured significant interest from researchers for its potential to enhance topic expressiveness, cohesion, and document clustering performance. This primarily affects the right factor in the NMF matrix product, the document–topic matrix. However, there remains a research gap concerning how semantic enhancements influence the left factor, the topic–word matrix. This study addresses this gap by experimentally demonstrating the feasibility of these enhancements.

3. Methodology

Figure 1 illustrates the generic pipeline of the proposed methodology, which consists of four principal steps:
  • The creation of the document–word matrix. This matrix represents the distribution of words across the documents in the corpus. Each entry in the matrix reflects the frequency of a word’s occurrence in a specific document, providing a foundational data structure for further analysis.
  • The creation of the word–seed matrix. This matrix is formed by calculating pairwise cosine similarities between the embeddings of words and predefined seed words. Seed words are selected by a domain expert based on their relevance to the domain, helping to anchor the semantic space around key concepts.
  • The joint factorization of the created matrices. The document–word and word–seed matrices are jointly factorized to produce a semantically refined topic–word matrix. This step applies the semantic NMF algorithm and allows for a deeper, more meaningful extraction of topics that are semantically coherent.
  • The extraction of most relevant terms. From each topic in the resulting topic–word matrix, the most relevant terms are extracted. These terms are identified based on their weighted contribution to each topic, highlighting the terms that best define and represent the underlying topics within the domain.
Below, we provide a brief background on NMF, describe the standard NMF algorithm for term extraction, and then move on to the semantic NMF algorithm, detailing how to construct the word–seed matrix.

3.1. Standard NMF for Term Extraction

Non-negative matrix factorization (NMF) aims to closely approximate the non-negative matrix A of dimension m × n with the product of two non-negative matrices W and H of dimensions m × k and k × n , respectively, such that A W H . Here, k is smaller than both m and n, indicating a reduction in dimensionality. This allows us to capture the core features of the data represented by matrix A. In this factorization, the matrix W is referred to as the basis matrix, while the matrix H is known as the coefficient matrix or vector-encoding matrix. The approximation A W H is achieved by finding matrices W and H that minimize the cost function L ( A ,   W H ) . The cost function (also referred to as the error function or objective function) quantifies the discrepancy between the original matrix A and the product WH using either the Frobenius norm or the Kullback–Leibler divergence. Below, NMF is formulated as a non-convex optimization problem, employing the Frobenius norm · F as the cost function:
min H , W L A , W H = min H , W A W H F 2 = min H , W i j A i j ( W H ) i j 2
A non-convex solution space for NMF implies the existence of multiple local minima, none of which are guaranteed to be a global minimum. The renowned algorithm developed by Lee and Seung [11] solves Equation (1) through iterative multiplicative transformations of matrices W and H, starting from random initial matrices. The algorithm ensures a monotonic, step-by-step decrease in the cost function; however, like other NMF algorithms, it does not necessarily lead to the best possible decomposition, i.e., the global minimum. Below are the multiplicative rules for each iteration step of the algorithm, where the symbol ⊙ denotes element-wise multiplication, also known as the Hadamard product:
H H W T A W T W H W W A H T W H H T
The algorithm stops based on one of the following conditions: (1) a convergence criterion, which is met when the decrease in the cost function between successive iterations falls below a predetermined threshold; (2) a maximum number of iterations, which prevents the algorithm from running indefinitely, especially if convergence is slow or the algorithm oscillates; (3) the stability of factors, which occurs if the matrices W and H stabilize. The choice of initial values for matrices W and H can significantly affect the results of NMF, including the speed of convergence and the quality of the local solution obtained [27,28]. Various initialization strategies are used, such as random assignments, data-based initialization, or special heuristic methods [27].
These features render NMF exceptionally useful in NLP tasks such as topic modeling, document clustering, and term extraction, where finding an acceptable local solution often suffices. In these applications, the ability to reveal the underlying structure of the data is often more critical than achieving absolute solution optimality. This focus on structure over optimality aligns with key principles of machine learning, where understanding the underlying patterns can lead to more insightful outcomes. This is often discussed in the context of overfitting, which represents a model that is “too optimal” for the training data but fails to generalize and effectively capture the broader structure [29]. By emphasizing the discovery of data structure, NMF supports their interpretation, which is particularly valuable in domains like text analytics.
Let us formulate the NMF task for topic modeling, along with its subsequent applications in document clustering and term extraction. Given a corpus consisting of m documents and a vocabulary associated with this corpus comprising n words, let A be a document–word matrix of dimension m × n . The element a i j of matrix A represents the frequency of occurrences of the j -th word in the vocabulary within the i -th document of the corpus i = 1 , , m ,   j = 1 , , n . The task requires the approximate decomposition of the document–word matrix A (m × n) into the product of document–topic matrix W (m × k) and topic–word matrix H (k × n), such that A W H . Here, k indicates the number of core topics in the corpus represented by matrix A, as shown in Figure 2. For the task of document clustering, the basis matrix W becomes particularly intriguing due to its role in grouping documents based on similar topics. Conversely, for the task of term extraction, the matrix of encoding vectors, H , is of significant interest because it captures the structural organization of topics through words.
The approach to term extraction using NMF is straightforward: extract the top T words with the highest coefficients from each of the k topics in the transposed matrix H T , resulting in kT candidate terms, as shown in Figure 3. However, since a word can appear at the top of several topics (having high coefficients in multiple topics), the final number of unique candidates may be significantly less than kT after duplicates are removed. As noted in [30], a close examination of the encoding vectors produced by NMF reveals a high degree of overlapping, indicating that some words can be representative of multiple topics.
Below, we demonstrate the application of NMF to extract terms from a corpus of 14 documents concerning the topics of China and Japan. The selection of topics is intentional, drawing from an inspiring example in a classic textbook on information retrieval (refer to [31], ch.13). The original example explores a nuanced case of binary classification involving five documents, as shown in Table 1. Our enhancement of this example aims to offer a clearer understanding of NMF’s capabilities, assessing standard versus semantic capacities. Consequently, our example is continuous, and we will continue it in Section 3.2 and Section 3.3 of this Section.
A fragment of our corpus is depicted in Table 2. To simplify our analysis, we construct a document–word matrix from this corpus, only using named entities such as ‘GPE’ (geopolitical entities), ‘LOC’ (locations), and ‘NORP’ (nationalities, religious and political groups) as features, instead of the entire corpus vocabulary. Despite the feature reduction, the resulting matrix has a high level of sparsity, a typical attribute observed in NLP applications (see Figure 4). ‘Japan’, ‘Chinese’ and ‘China’ are the most frequently occurring words in the corpus, appearing 9, 6 and 5 times, respectively. For comparison, rare words such as ‘Hokkaido’ or ‘Guangzhou’, which appear only once in the corpus, account for more than half of the total feature set. Applying NMF to the document–word matrix, we then concentrate on the topic–word matrix H and extract the top 5 words from each of the two topics. As we can see from Figure 5, the top 5 words in both topics include ‘Yokohama’ and ‘China’. This confirms on one hand that NMF allows for overlap in the encoding vectors, and on the other hand, it indicates the insufficient separation of topics in the original corpus, where the cross-topics words ‘Yokohama’ and ‘Chinese’ appear in the same document. Besides the pair of ‘Yokohama’ and ‘Chinese’, the words ‘Nanjing’ and ‘Japan’ also co-occur in the same document, resulting in ’Nanjing’ being placed into a topic that is not its own.

3.2. Semantic NMF for Term Extraction

Word embeddings are dense vector representations of words learned by neural networks [32]. These neural embeddings are trained to capture linguistic contexts, so that similar words have vectors that are closely positioned within the dense vector space, efficiently encoding both semantic and syntactic relationships among words. In the semantic formulation of NMF, besides the original document–word matrix A, a word–word matrix M of dimension n × n is introduced [10]. The element m i j of matrix M represents the cosine similarity between the i-th and j-th word embeddings in the dense vector space (i = 1 , , n , j = 1 , , n ). Without loss of generality, matrix M can also be defined as a word–feature matrix of dimension n × n′ [10], so the i-th row of M represents the embedding of the i-th word in a special feature space.
A joint decomposition of the document–word matrix A and the word–feature matrix M into two separate products A W H and M H T Q is required, sharing a common factor H (see Figure 6). Thanks to the joint factorization, it is expected that topic–word H matrix will place semantically related words closer to each other in the compressed space of topics of dimension k [10]. Thus, semantic NMF employs a complex cost function L, which, as in standard NMF, can be defined using the Frobenius norm:
min H , W , Q L A , W , H , M , Q = min H , W , Q L A , W H + λ · L ( M , H T Q ) = min H , W , Q A W H F 2 + λ M H T Q F 2
where the parameter λ is used for regularization. When it is greater than 1, the matrix M has a more significant impact on the NMF result. Conversely, when λ is less than 1, the matrix A has a more significant impact. When λ is 0, semantic NMF degenerates into the standard NMF.
The semantic NMF algorithm [10] operates in a manner like the standard Lee and Seung NMF algorithm [11]. At the initial step, matrices W, H, and Q of dimensions m × k , k × n , and k × n , respectively, are randomly generated. Subsequently, iterative updates of matrices W, H, and Q are performed until one of the stopping criteria listed above, is met:
W W A H T W H H T               H H W T A + λ Q M T W T W H + λ Q Q T H Q Q H M H H T Q
Below, we extend our example, initiated in Section 3.1 of the current section. To construct the matrix M, embedding vectors are obtained for each word considered in the document–word matrix using the FastText of version 0.9.3 ‘wiki-news-300d-1M-subword‘ embedding model [33]. Subsequently, we calculate the cosine similarities between these embedding vectors. Figure 7 displays the resultant matrix M. Applying semantic NMF to these two matrices A and M , we then focus on the topic–word matrix H and extract the top 5 words from each of the two topics. As illustrated in Figure 8, the application of Semantic NMF with λ = 3 results in clearly distinct topics, showcasing the model’s effectiveness in achieving thematic separation. This enhanced clarity is a direct consequence of incorporating the semantic relationships captured in matrix M.

3.3. Constructing the Word–Seed Matrix for Semantic NMF

The symmetric word–word matrix M of dimension n × n , which integrates relationships among words into the semantic NMF algorithm, is a particular case within a broader class of matrices, M , of dimension n × n , offering word representations in various semantic feature spaces. For instance, the word–word matrix M of dimension n × n can be easily replaced by the word embedding matrix of dimension n × 300 , where 300 is the common length of embedding vectors in the well-known word2vec model [32]. In this study, we expand on the idea of mapping words into a compressed space of semantic features, which we refer to as domain seeds. Therefore, we replace the original word–word matrix, which represents pairwise cosine similarities between word embeddings, with a reduced submatrix that keeps all rows but only includes the columns corresponding to seed words (see Figure 9).
Below, we continue our example from Section 3.1 and Section 3.2, using three specific seed words, namely, ’Japan’, ’Chinese’, and ’China’, to reduce our word–word matrix M (see Figure 10a). We apply semantic NMF using reduced matrix M . Despite the reduction, the semantic NMF algorithm still effectively distinguishes between topics, as evidenced by the clear topic separation shown in Figure 10b,c.

4. Experiments and Results

4.1. Datasets

To evaluate semantic NMF for term extraction, two datasets, entitled titled ‘Geography & History’ (GH) and ‘National Heroes’ (NH), were created using ChatGPT-4, with no more than 5% of the sentences derived from Wikipedia. Each dataset comprises 1000 sentences, manually annotated and evenly classified into 10 categories corresponding to the following countries: China, Egypt, Greece, Iran, Japan, Kazakhstan, Mongolia, Russia, Turkey, and Uzbekistan. Each sentence in the datasets contains one or more terms related to the corresponding country. In the GH dataset, terms include geographical names, referred to as geonyms. In the NH dataset, the terms include the names of famous people, deities, and rulers, referred to as anthroponyms or theonyms.
The process of creating each dataset involves three steps: (1) the selection of terms; (2) the generation and annotation of sentences; and (3) the manual verification of terms and sentences. During the first step, two experts manually select terms for each of the 10 countries included in the datasets. The terms should meet three criteria: (1) they should be culturally connected and commonly associated with the country, and preferably rarely mentioned outside of the original geographical and cultural context; (2) they should be recognizable at the international level; and (3) they should be present in the trained FastText embedding model.
At the second step, experts generate sentences containing selected terms with the help of Chat-GPT-4. For example, for the GH dataset, their requests can be structured as follows: ‘Generate a sentence where the geonym XXX associated with the country YYY is mentioned’. This is as illustrated in Figure 11. For the NH dataset, the requests can be structured as follows: ‘Generate a sentence where the anthroponym/theonym XXX is mentioned, such that the sentence also includes the geonym YYY associated with the country ZZZ’, as shown in Figure 12. At the third step, the outputs of ChatGPT-4 are manually checked for reliability and consistency, with any sentences that exhibit anomalies or hallucinations being corrected or refined. Table 3 provides random examples of sentences from both datasets for each of the 10 countries.
Detailed datasets statistics are presented in Table 4. As indicated in the Table 4, although all countries are represented by the same number of sentences (100 each), Uzbekistan accounts for the highest number of unique geonyms in the GH dataset, while Iran has the highest number of unique anthroponyms and theonyms in the NH dataset.
If we sum up the number of unique terms in Table 4, we obtain 653 terms for the GH dataset and 476 terms for the NH dataset. For the NH dataset, this number matches the real number of unique terms, since classes do not share common terms. For the GH dataset, classes share common terms; for example, the term ‘Altai’ occurs in sentences of the Russian, Mongolian, and Kazakhstani classes. So, 653 is the number of terms with duplicates, whereas the number of unique terms in the GH dataset is 461. Regarding words, the most frequently used word in the GH dataset is ‘city,’ which appears 136 times, while the most frequently used word in the NH dataset is ‘born,’ which appears 159 times. Table 5 displays the top 10 words for both datasets. Regarding terms, the most frequent geonyms in the GH dataset are ‘Central’ and ‘Kazakhstan,’ while the most frequent anthroponyms in the NH dataset are ‘Chingis’ and ‘Khan.’ Figure 13 illustrates term clouds for both datasets.

4.2. Experimental Settings

This subsection outlines the experimental settings used to assess the efficiency of semantic NMF for term extraction. The experiments aim to evaluate the precision, recall, and F1 scores of semantic NMF when applied to the GH and NH datasets. The experimental setup involves defining four key parameters of semantic NMF approach:
  • Number of seeds.
  • Number of topics (k).
  • Regularization parameter (λ).
  • Number of top words extracted from each topic (T).

4.2.1. Selection of the Number of Seeds

As described earlier, the word–seed matrix represents the cosine similarities between corresponding embeddings of the vocabulary words and seed words. Embeddings are generated using the FastText pre-trained model. Two different sets of seed words are selected to evaluate the impact of seeding on the performance of semantic NMF: (1) a set of 20 seed words, with 2 seed words per class; (2) a set of 30 seed words, with 3 seed words per class (see Table 6).
The seed words used in this study are manually chosen based on expert prior knowledge of the domain. This manual selection utilizes domain-specific expertise to ensure that the chosen seeds are highly relevant to the targeted topics. Alternatively, techniques such as TF-DCF [34] can be employed to automatically extract seed words from the text corpus. This method identifies words that are significant within the domain corpus relative to the other corpora. The ablation study on the number of seeds is provided in Table A4 in Appendix A.
For the GH dataset, the size of the corpus vocabulary is 2923 words, so the dimensions of the document–word matrix are 1000 × 2923, and the dimensions of the word–seed matrices are 2923 × 20 and 2923 × 30 for 20 and 30 seed words, respectively, depending on the number of seed words. For the NH dataset, the size of the corpus vocabulary is 3695 so the dimensions of the document–word matrix are 1000 × 3695, and the dimensions of the word–seed matrices are 3695 × 20 and 3695 × 30 for the samples with 20 and 30 seed words, respectively.

4.2.2. Selection of the Number of Topics k

The selection of the number of topics (k) for semantic NMF poses a significant challenge. Although methods such as the elbow method or the evaluation of model coherence provide some guidance, no universally accepted approach ensures the optimal selection of k across diverse contexts. The choice of k is profoundly influenced by the complexity of the underlying data and the specific objectives of the analysis. In this study, we set the number of topics to 10, corresponding to the number of predefined classes (countries) in both datasets. Results of the initial experiments with k varying from 2 to 20, as presented in Table A1 in Appendix A, partially confirm our intuitive settings.
As shown in Figure 14, the optimal number of topics k for the GH dataset corresponds with the predefined 10 classes. This alignment can be explained by the clear division of geo-historical terms based on territorial principles. However, for the NH dataset, the optimal number of topics is not only 10 but also 4. We can explain this by the fact that national heroes of the past and present cannot be strictly divided by territorial principles. For instance, names of heroes from countries of the former socialist block (Russia, Kazakhstan, Mongolia, and Uzbekistan) ended up in the same topic, while another topic included names of prominent political leaders (Stalin, Atatürk, etc.). Clearly, the embeddings pre-trained on diverse semantic relationships significantly influenced this division.
Adding to this, the grouping of such varied historical figures under broad topical umbrellas underscores the potential and challenges of semantic NMF. It illustrates how deeply embedded cultural and historical connections can transcend contemporary geopolitical boundaries, revealing complex interrelations that traditional clustering algorithms might miss. This aspect of semantic embeddings showcases their ability to provide nuanced insights into data. However, this also poses a challenge as it requires oversight of the semantic structures and complicates the interpretation of the results.

4.2.3. Selection of the Regularization Parameter λ

The regularization parameter λ is tested from 1 to 35 in the ablation study in, the results of which are shown in Table A2 in Appendix A. The results indicate that higher values of λ improve the F1-score, with no further increase beyond 30 as shown in Figure 15. Therefore, we fix λ at 30.

4.2.4. Selection of the Number of Top Words T

The number of top words T extracted from each topic is set to 70 both for the GH and NH dataset, resulting in approximately 700 words from 10 topics. After removing duplicates, this yields about 450–550 unique words, approximately matching the number of true terms. The ablation study on the number of extracted top words T is provided in Table A3 in Appendix A. The semantic NMF is also evaluated using anti-seeds, which are frequently occurring words in the dataset that are used to identify and eliminate topics with generic words. Anti-seeds are selected from the most frequent words. Specifically, we identify the most common words in each dataset, as these words tend to be generic and less informative for distinguishing specific topics of interest. We begin by analyzing the word frequency in the entire dataset. This involves creating a frequency distribution of all words. From this frequency distribution, we select the top words as anti-seeds. For our study, we chose the top 10 most frequent words as these words were manually inspected to be generic for the topics of interest for each dataset. These words can be found in Table 5. Consequently, four experimental setups are defined, as shown in Table 7.

4.3. Baselines

To compare the effectiveness of semantic NMF approaches to term extraction, we evaluate three established baselines: standard NMF, BERTopic and KeyBERT. For semantic NMF, standard NMF, and BERTopic, we use the same number of topics k and the same number of extracted top words T . BERTopic is a topic-modeling approach that employs BERT embeddings along with c-TF-IDF to generate dense clusters. As a default, BERTopic uses HDBSCAN to perform its clustering; however, it was changed to K-means, allowing us to specify the number of topics to extract. By standardizing these critical parameters across these three methods, the evaluation becomes focused solely on the effectiveness of each method within the same structural framework. This setup ensures that differences in performance are attributable to the intrinsic capabilities of the methods themselves rather than external settings, making the comparison as “apple-to-apple” as possible.
Unlike the other two baseline methods, KeyBERT does not align perfectly in terms of parameter settings for a direct comparison. Specifically, for KeyBERT, the number of terms extracted is set to be substantially higher than that for the other methods, which inherently increases its recall. This adjustment is necessary because KeyBERT is designed to extract keywords rather than terms, necessitating the specification of the number of words to be extracted from each sentence. As a result, setting the minimum number of words to be extracted to 2 elevates the total number of lexical units to 2000, significantly more than its counterparts. However, despite these methodological divergences, KeyBERT remains a crucial part of our analysis due to its high effectiveness and reliance on BERT-based embeddings. Like semantic NMF, KeyBERT provides seeds in order to softly manage desired terms. However, initial experiments show that seeding is unnecessary when extracting only two words per sentence with KeyBERT. Table 8 shows the results of the baselines.
NMF, BERTopic, and KeyBERT allow for term repetition when extracting from different topics or documents (unlike e.g., the TF-IDF method which penalizes repetitions). Therefore, the column “Number of extracted terms” in Table 8 contains two numbers separated: the first indicates the total number of extracted terms, and the second shows the number of extracted terms after duplicates are removed.

5. Results and Discussion

Table 9 provides the results for each of the described experimental setups for both datasets. For the GH dataset, the results show an improvement in precision, recall, and F1-score with increasing the number of seeds, as indicated by Setup 1 and Setup 2. Furthermore, the use of anti-seeds (Setups 3 and 4) appears to increase the precision notably while slightly lowering the recall compared to setups without anti-seeds. The NH dataset results reveal a more moderate overall performance, but there is an increase in F1-score for Setup 4 compared to Setup 2 indicating the impact of using anti-seeds. The setups show better performance across both datasets when compared to the standard NMF.
The F-score of semantic NMF for the GH dataset is significantly superior to the F-scores of both baselines, whereas this superiority is maintained for the NH dataset when compared to standard NMF and BERTopic. Closer analysis of the results between semantic NMF and KeyBERT reveals that the precision of semantic NMF is higher, but its recall is much lower, which accounts for KeyBERT’s superior performance. This is primarily because semantic NMF is at a disadvantage: it extracts only 700 words, 70 for each of the 10 topics, whereas KeyBERT extracts 2000 words, 2 for each sentence. The broader the set of words, the greater the likelihood of a term appearing in it, thereby achieving the greater recall. There is a sensitive point in our approach when the optimal number of words to be extracted for a balance between precision and recall is unknown. Expanding the word set excessively leads to an inevitable increase in recall and a corresponding decrease in precision.
Consequently, additional experiments were conducted for semantic NMF, with the number of extracted words ranging from 1000 to 2000 to ensure parity with KeyBERT. Semantic NMF achieved its best F-score of 58.9 with 1400 words, still outperforming KeyBERT, which achieved its best score of 57.6. Similarly, for the sake of consistency, we conducted additional experiments for standard NMF and BERTopic on the NH dataset, with the number of extracted words ranging from 1000 to 2000. The best results for all three considered methods are provided in Table 10. The graphical representation of the best F-scores is given in Figure 16.
The differing results between datasets require further investigation, a question we leave for future research. The most apparent explanation is the higher cohesion of the first dataset, which yields a more compact term space.

6. Conclusions

This research explores the effectiveness of the semantic NMF approach for term extraction within two datasets. Our experiments indicate that semantic NMF significantly outperforms both traditional NMF and KeyBERT, a model that employs deep learning-based embeddings to identify keywords. The superior performance of semantic NMF can be attributed to its enhanced ability to capture and utilize the semantic relationships among words. Comparatively, standard NMF, though effective in identifying prevalent topics by decomposing the document–word matrix, often fails to capture the semantic relationships between words due to its reliance on surface-level frequency-based context analysis. KeyBERT, while innovative in its use of BERT embeddings for a deeper understanding of textual context, still cannot consistently grasp the broader topic structures that semantic NMF can since it works at the sentence level rather than the domain level.
However, a significant limitation of semantic NMF is its dependence on high-quality embeddings. When the number of candidate words is large, the resulting word–word similarity matrix based on embeddings tends to overestimate relationships that are not relevant to the domain. This excess of irrelevant high-scoring relationships introduces noise into the factorization process and reduces the accuracy of term extraction. This limitation became especially apparent when using semantic NMF to analyze bigrams or trigrams, as this significantly increases the number of relationships that are highly scored by embeddings, thereby introducing noise into the space.
In the related work section, we discuss approaches that can manipulate the similarity matrix by introducing ML (must link) and CL (cannot link) supervisory information, and this will be our focus for future research. By refining these methods, we aim to reduce the noise and enhance the accuracy of term extraction, particularly for multi-word terms. Addressing these challenges will be crucial for improving the robustness and applicability of semantic NMF in various domains.

Author Contributions

Conceptualization, A.N.; methodology, A.N.; software, A.A., K.R. and A.N.; validation, A.N. and A.A.; formal analysis, Y.B.; data curation, A.M. and A.N.; writing, A.N. (Section 1, Section 2, Section 3, Section 5 and Section 6), A.M. (Section 4.1), A.A. (Section 4.2 and Section 4.3); visualization, A.N. and K.R.; supervision, A.N.; project administration, Y.B. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Ministry of Science and Higher Education of the Republic of Kazakhstan, grant number AP19677756.

Data Availability Statement

The dataset is available in the Hugging Face repository at https://doi.org/10.57967/hf/2627 (accessed on 23 June 2024) and the code is available in the GitHub repository https://github.com/Almas-Alz/semanticNMF-term extraction (accessed on 23 June 2024).

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AbbreviationDefinition
NMFnon-negative matrix factorization
BERTbidirectional encoder representations from transformers
KeyBERTkeyword extraction technique that leverages bidirectional encoder representations from transformers
BERTopicbidirectional encoder representations from transformers for topic modeling
NLPnatural language processing
SSNMFsemi-supervised non-negative matrix factorization
SeNMFksemantic non-negative matrix factorization/semantic assisted non-negative matrix
TF-IDFterm frequency–inverse document frequency
SeNMFk-SPLITsemantic non-negative matrix factorization—SPLIT
GNMFguided non-negative matrix factorization
GSSNMFguided semi-supervised non-negative matrix factorization
MLmust link
CLcannot link
GHGeography & History
NHNational Heroes

Appendix A. Ablation Study of Number of Topics k, Regularization Parameter λ, Number of Extracted Top Words T and Number of Seeds

Table A1. Number of topics k ranging from 2 to 20.
Table A1. Number of topics k ranging from 2 to 20.
DatasetNumber of Topics kRegularization λNumber of SeedsNumber of Extracted WordsPrecisionRecallF1-Score
GH230301000/7640.5730.9520.716
33030999/7070.6170.9480.747
430301000/6510.6540.9260.767
530301000/6610.640.920.755
63030996/6840.6110.9090.731
73030994/6650.6260.9040.74
830301000/6530.6320.8980.742
93030999/5750.7040.880.783
1030301000/5790.7180.9040.801
113030990/6260.660.8980.761
123030996/6260.6550.8910.755
133030988/6480.630.8870.736
143030994/6010.6760.8830.765
153030990/6110.6610.8780.754
163030992/6180.6290.8460.722
173030986/5940.660.8520.744
183030990/5920.6320.8130.711
193030988/5900.6320.8110.71
2030301000/5790.630.7930.703
NH230301000/4980.50.5230.511
33030999/6100.4620.5920.519
430301000/9170.4470.8610.589
530301000/7050.440.6510.525
63030996/6250.5090.6680.578
73030994/7570.460.7310.564
830301000/6970.4820.7060.573
93030999/6970.4920.7210.585
1030301000/6320.5160.6850.588
113030990/7570.4480.7120.55
123030996/7150.4870.7310.584
133030988/7330.4750.7310.576
143030994/7450.4540.710.554
153030990/7280.470.7180.568
163030992/7310.4530.6950.548
173030986/7200.4540.6870.547
183030990/7090.4610.6870.552
193030988/7320.4450.6850.54
2030301000/6590.4830.6680.56
Table A2. Regularization parameter λ, ranging from 1 to 35.
Table A2. Regularization parameter λ, ranging from 1 to 35.
DatasetRegularization λNumber of Topics kNumber of SeedsNumber of Extracted WordsPrecisionRecallF1-Score
GH110301000/6270.40.5460.462
510301000/6950.5480.8280.66
1010301000/6500.6290.8890.737
1510301000/6400.6380.8870.742
2010301000/5950.6860.8870.773
2510301000/5950.6920.8960.781
3010301000/5910.6950.8930.782
3510301000/5930.6960.8980.784
NH110301000/2990.6220.3910.48
510301000/5210.5280.5780.552
1010301000/5980.5050.6340.562
1510301000/6340.5030.670.575
2010301000/7080.490.7290.586
2510301000/6890.4980.7210.589
3010301000/6920.5030.7310.596
3510301000/6920.50.7270.592
Table A3. Number of extracted top words T, ranging from 50 to 200.
Table A3. Number of extracted top words T, ranging from 50 to 200.
DatasetExtracted Top Words TRegularization λNumber of Topics kNumber of SeedsNumber of Extracted WordsPrecisionRecallF1-Score
GH50301030500/3980.8540.7390.793
60301030600/4550.8070.7980.802
70301030700/4980.7770.8410.808
80301030800/5390.7420.870.801
90301030900/5810.7110.8980.793
1003010301000/6130.680.9070.777
1103010301100/6420.6590.920.768
1203010301200/6730.6330.9260.752
1303010301300/7040.6080.930.735
1403010301400/7460.5820.9430.72
1503010301500/7660.5690.9480.711
1603010301600/8000.5460.950.694
1703010301700/8260.5310.9540.683
1803010301800/8650.5090.9570.664
1903010301900/9010.4910.9610.65
2003010302000/9360.4730.9630.635
NH50301030500/4640.5060.4940.5
60301030600/4960.5380.5610.549
70301030700/5140.5350.5780.556
80301030800/5770.510.6180.558
90301030900/6340.4940.6580.564
1003010301000/6880.4830.6970.57
1103010301100/7340.4730.7290.574
1203010301200/7760.4640.7560.575
1303010301300/8180.4540.7790.573
1403010301400/8570.4430.7980.57
1503010301500/8130.4580.7820.577
1603010301600/8480.450.8030.577
1703010301700/8810.4420.8170.573
1803010301800/9120.4310.8260.566
1903010301900/9420.4260.8420.566
2003010302000/9680.4190.8530.562
Table A4. Number of seeds, ranging from 20 to 30.
Table A4. Number of seeds, ranging from 20 to 30.
DatasetNumber of SeedsRegularization λNumber of Topics kNumber of Extracted WordsPrecisionRecallF1-Score
GH2030101000/6240.6310.8570.727
2130101000/5980.6640.8630.75
2230101000/6130.6350.8460.725
2330101000/6270.6320.8610.729
2430101000/6110.6680.8870.762
2530101000/5560.7180.8670.785
2630101000/5830.690.8740.771
2730101000/6250.6590.8960.759
2830101000/5770.7190.9020.8
2930101000/6140.6790.9070.777
3030101000/6130.680.9070.777
NH2030101000/6910.470.6830.557
2130101000/7280.4420.6760.535
2230101000/7120.4260.6370.51
2330101000/7140.4310.6470.518
2430101000/6560.4850.6680.562
2530101000/7620.4190.670.515
2630101000/7440.4580.7160.559
2730101000/6580.4730.6530.549
2830101000/7710.4540.7350.561
2930101000/8320.4310.7540.549
3030101000/6320.5160.6850.588

References

  1. QasemiZadeh, B. Investigating the Use of Distributional Semantic Models for Co-Hyponym Identification in Special Corpora. Ph.D. Thesis, National University of Ireland, Galway, Ireland, 2015. [Google Scholar]
  2. Drouin, P.; Grabar, N.; Hamon, T.; Kageura, K.; Takeuchi, K. Computational terminology and filtering of terminological information: Introduction to the special issue. Terminology 2018, 24, 1–6. [Google Scholar]
  3. Fusco, F.; Staar, P.; Antognini, D. Unsupervised Term Extraction for Highly Technical Domains. arXiv 2022, arXiv:2210.13118. [Google Scholar]
  4. Lang, C.; Wachowiak, L.; Heinisch, B.; Gromann, D. Transforming term extraction: Transformer-based approaches to multilingual term extraction across domains. Find. Assoc. Comput. Linguist. ACL-IJCNLP 2021, 2021, 3607–3620. [Google Scholar]
  5. Terryn, A.R.; Hoste, V.; Lefever, E. HAMLET: Hybrid adaptable machine learning approach to extract terminology. Terminol. Int. J. Theor. Appl. Issues Spec. Commun. 2021, 27, 254–293. [Google Scholar] [CrossRef]
  6. Hazem, A.; Bouhandi, M.; Boudin, F.; Daille, B. Cross-lingual and cross-domain transfer learning for automatic term extraction from low resource data. In Proceedings of the Thirteenth Language Resources and Evaluation Conference, Marseille, France, 20–25 June 2022; pp. 648–662. [Google Scholar]
  7. Vukovic, R.; Heck, M.; Ruppik, B.M.; van Niekerk, C.; Zibrowius, M.; Gašić, M. Dialogue term extraction using transfer learning and topological data analysis. arXiv 2022, arXiv:2208.10448. [Google Scholar]
  8. Qin, Y.; Zheng, D.; Zhao, T.; Zhang, M. Chinese terminology extraction using EM-based transfer learning method. In Computational Linguistics and Intelligent Text Proceedings of the 14th International Conference, CICLing 2013, Samos, Greece, 24–30 March 2013; Part I; Springer: Berlin/Heidelberg, Germany, 2013; pp. 139–152. [Google Scholar] [CrossRef]
  9. Nugumanova, A.; Akhmed-Zaki, D.; Mansurova, M.; Baiburin, Y.; Maulit, A. NMF-based approach to automatic term extraction. Expert Syst. Appl. 2022, 199, 117179. [Google Scholar] [CrossRef]
  10. Febrissy, M.; Salah, A.; Ailem, M.; Nadif, M. Improving NMF clustering by leveraging contextual relationships among words. Neurocomputing 2022, 495, 105–117. [Google Scholar] [CrossRef]
  11. Lee, D.D.; Seung, H.S. Algorithms for non-negative matrix factorization. In Proceedings of the Neural Information Processing Systems (NIPS), Denver, CO, USA, 1 January 2000; pp. 556–562. [Google Scholar]
  12. Gao, J.; He, D.; Tan, X.; Qin, T.; Wang, L.; Liu, T.Y. Representation degeneration problem in training natural language generation models. arXiv 2019, arXiv:1907.12009. [Google Scholar]
  13. Grootendorst, M. KeyBERT: Minimal keyword extraction with BERT. Zenodo. 2020. Version 0.8.0. Available online: https://zenodo.org/records/8388690 (accessed on 29 April 2024).
  14. Grootendorst, M. BERTopic: Neural topic modeling with a class-based TF-IDF procedure. arXiv 2022, arXiv:2203.05794. [Google Scholar]
  15. Lee, H.; Yoo, J.; Choi, S. Semi-supervised nonnegative matrix factorization. IEEE Signal Process. Lett. 2009, 17, 4–7. [Google Scholar] [CrossRef]
  16. Shen, B.; Makhambetov, O. Hierarchical semi-supervised factorization for learning the semantics. J. Adv. Comput. Intell. Intell. Inform. 2014, 18, 366–374. [Google Scholar] [CrossRef]
  17. Vangara, R.; Skau, E.; Chennupati, G.; Djidjev, H.; Tierney, T.; Smith, J.P.; Bhattarai, M.; Stanev, V.G.; Alexandrov, B.S. Semantic nonnegative matrix factorization with automatic model determination for topic modeling. In Proceedings of the 2020 19th IEEE International Conference on Machine Learning and Applications (ICMLA), Miami, FL, USA, 14–17 December 2020; pp. 328–335. [Google Scholar] [CrossRef]
  18. Vangara, R.; Bhattarai, M.; Skau, E.; Chennupati, G.; Djidjev, H.; Tierney, T.; Smith, J.P.; Stanev, V.G.; Alexandrov, B.S. Finding the number of latent topics with semantic non-negative matrix factorization. IEEE Access 2021, 9, 117217–117231. [Google Scholar] [CrossRef]
  19. Eren, M.E.; Solovyev, N.; Bhattarai, M.; Rasmussen, K.Ø.; Nicholas, C.; Alexandrov, B.S. SeNMFk-split: Large corpora topic modeling by semantic non-negative matrix factorization with automatic model selection. In Proceedings of the 22nd ACM Symposium on Document Engineering, San Jose, CA, USA, 20–23 September 2022; pp. 1–4. [Google Scholar] [CrossRef]
  20. Budahazy, R.; Cheng, L.; Huang, Y.; Johnson, A.; Li, P.; Vendrow, J.; Wu, Z.; Molitor, D.; Rebrova, E.; Needell, D. Analysis of Legal Documents via Non-negative Matrix Factorization Methods. arXiv 2021, arXiv:2104.14028. [Google Scholar]
  21. Vendrow, J.; Haddock, J.; Rebrova, E.; Needell, D. On a guided nonnegative matrix factorization. In Proceedings of the ICASSP 2021–2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Toronto, ON, Canada, 6–11 June 2021; pp. 3265–32369. [Google Scholar] [CrossRef]
  22. Li, P.; Tseng, C.; Zheng, Y.; Chew, J.A.; Huang, L.; Jarman, B.; Needell, D. Guided semi-supervised non-negative matrix factorization. Algorithms 2022, 15, 136. [Google Scholar] [CrossRef]
  23. Kuang, D.; Yun, S.; Park, H. SymNMF: Nonnegative low-rank approximation of a similarity matrix for graph clustering. J. Glob. Optim. 2015, 62, 545–574. [Google Scholar] [CrossRef]
  24. Jia, Y.; Liu, H.; Hou, J.; Kwong, S. Semisupervised adaptive symmetric non-negative matrix factorization. IEEE Trans. Cybern. 2020, 51, 2550–2562. [Google Scholar] [CrossRef] [PubMed]
  25. Jing, L.; Yu, J.; Zeng, T.; Zhu, Y. Semi-supervised clustering via constrained symmetric non-negative matrix factorization. In Proceedings of the Brain Informatics: International Conference, Macau, China, 4–7 December 2012; pp. 309–319. [Google Scholar] [CrossRef]
  26. Gadelrab, F.S.; Haggag, M.H.; Sadek, R.A. Novel semantic tagging detection algorithms based non-negative matrix factorization. SN Appl. Sci. 2020, 2, 54. [Google Scholar] [CrossRef]
  27. Esposito, F. A review on initialization methods for nonnegative matrix factorization: Towards omics data experiments. Mathematics 2021, 9, 1006. [Google Scholar] [CrossRef]
  28. Wild, S.; Curry, J.; Dougherty, A. Improving non-negative matrix factorizations through structured initialization. Pattern Recognit. 2004, 37, 2217–2232. [Google Scholar] [CrossRef]
  29. Nannen, V. The Paradox of Overfitting. Master’s Thesis, Faculty of Science and Engineering, Rijksuniversiteit Groningen, Groningen, The Netherlands, 2003. Available online: https://fse.studenttheses.ub.rug.nl/id/eprint/8664 (accessed on 9 May 2024).
  30. Pascual-Montano, A.; Carazo, J.M.; Lehmann, D.; Pascual-Marqui, R.D. Nonsmooth nonnegative matrix factorization (nsNMF). IEEE Trans. Pattern Anal. Mach. Intell. 2006, 28, 403–415. [Google Scholar] [CrossRef]
  31. Christopher; Manning, D.; Raghavan, P.; Schütze, H. Introduction to Information Retrieval; Cambridge University Press: Cambridge, UK, 2008. [Google Scholar]
  32. Mikolov, T.; Chen, K.; Corrado, G.; Dean, J. Efficient estimation of word representations in vector space. arXiv 2013, arXiv:1301.3781. [Google Scholar] [CrossRef]
  33. Bojanowski, P.; Grave, E.; Joulin, A.; Mikolov, T. Enriching word vectors with subword information. Trans. Assoc. Comput. Linguist. 2017, 5, 135–146. [Google Scholar] [CrossRef]
  34. Lopes, L.; Vieira, R.; Fernandes, P. Domain term relevance through tf-dcf. In Proceedings of the 2012 International Conference on Artificial Intelligence (ICAI), Las Vegas, NV, USA, 16–19 July 2012. [Google Scholar]
Figure 1. The pipeline of the proposed methodology for unsupervised term extraction.
Figure 1. The pipeline of the proposed methodology for unsupervised term extraction.
Bdcc 08 00072 g001
Figure 2. NMF approximates document–word matrix A with the product of document–topic matrix W and topic–word matrix H .
Figure 2. NMF approximates document–word matrix A with the product of document–topic matrix W and topic–word matrix H .
Bdcc 08 00072 g002
Figure 3. The scheme for term extraction using the encoding vectors matrix H .
Figure 3. The scheme for term extraction using the encoding vectors matrix H .
Bdcc 08 00072 g003
Figure 4. The document–word matrix with reduced features.
Figure 4. The document–word matrix with reduced features.
Bdcc 08 00072 g004
Figure 5. The topic–word matrix, after transposition, is organized as follows: (a) sorted in descending order by coefficients in the Topic 1 column; (b) sorted in descending order by coefficients in the Topic 2 column.
Figure 5. The topic–word matrix, after transposition, is organized as follows: (a) sorted in descending order by coefficients in the Topic 1 column; (b) sorted in descending order by coefficients in the Topic 2 column.
Bdcc 08 00072 g005
Figure 6. Semantic NMF jointly approximates the document–word matrix A and the word–feature matrix M, sharing a common factor matrix H.
Figure 6. Semantic NMF jointly approximates the document–word matrix A and the word–feature matrix M, sharing a common factor matrix H.
Bdcc 08 00072 g006
Figure 7. The word–word matrix M, representing similarities between words in FastText embeddings space.
Figure 7. The word–word matrix M, representing similarities between words in FastText embeddings space.
Bdcc 08 00072 g007
Figure 8. The semantically enriched topic–word matrix, after transposition, is organized as follows: (a) sorted in descending order by coefficients in the Topic 1 column; (b) sorted in descending order by coefficients in the Topic 2 column.
Figure 8. The semantically enriched topic–word matrix, after transposition, is organized as follows: (a) sorted in descending order by coefficients in the Topic 1 column; (b) sorted in descending order by coefficients in the Topic 2 column.
Bdcc 08 00072 g008
Figure 9. The reduced word–seed matrix M, representing cosine similarities between all words and seed words.
Figure 9. The reduced word–seed matrix M, representing cosine similarities between all words and seed words.
Bdcc 08 00072 g009
Figure 10. Results of the semantic NMF using the word–seed matrix: (a) the word–seed matrix M ; (b) the top 5 words for Topic 1; (c) the top 5 words for Topic 2.
Figure 10. Results of the semantic NMF using the word–seed matrix: (a) the word–seed matrix M ; (b) the top 5 words for Topic 1; (c) the top 5 words for Topic 2.
Bdcc 08 00072 g010
Figure 11. Example of an expert’s request to ChatGPT-4 for the GH dataset.
Figure 11. Example of an expert’s request to ChatGPT-4 for the GH dataset.
Bdcc 08 00072 g011
Figure 12. Example of an expert’s request to ChatGPT-4 for the NH dataset.
Figure 12. Example of an expert’s request to ChatGPT-4 for the NH dataset.
Bdcc 08 00072 g012
Figure 13. (a) The term cloud for the GH dataset; (b) the term cloud for the NH dataset.
Figure 13. (a) The term cloud for the GH dataset; (b) the term cloud for the NH dataset.
Bdcc 08 00072 g013
Figure 14. (a) Ranging number of topics k for GH; (b) ranging number of topics k for NH. The blue line represents the F1-score for each number of topics k, while the red reference line highlights the maximum F1-scores observed.
Figure 14. (a) Ranging number of topics k for GH; (b) ranging number of topics k for NH. The blue line represents the F1-score for each number of topics k, while the red reference line highlights the maximum F1-scores observed.
Bdcc 08 00072 g014
Figure 15. (a) Ranging regularization λ for GH; (b) ranging regularization λ for NH.
Figure 15. (a) Ranging regularization λ for GH; (b) ranging regularization λ for NH.
Bdcc 08 00072 g015
Figure 16. The comparison of the best F-scores.
Figure 16. The comparison of the best F-scores.
Bdcc 08 00072 g016
Table 1. Original data from [27]: Document Set for Binary Classification.
Table 1. Original data from [27]: Document Set for Binary Classification.
docIDWords in DocumentIn c = China?
Training set1Chinese Beijing ChineseYes
2Chinese Chinese ShanghaiYes
3Chinese MacaoYes
4Tokyo Japan ChineseNo
Test set5Chinese Chinese Chinese Tokyo Japan?
Table 2. A fragment of the example corpus.
Table 2. A fragment of the example corpus.
No.Document
1Beijing, an ancient Chinese capital, is located 75 km away from the Great Wall of China.
2Although Shanghai is not the capital of China, it is the main Chinese metropolis.
3Macau, an autonomous territory, uniquely blends its rich cultural heritage within China, showcasing a distinct yet harmonious identity.
4Nanjing, being a significant center for Buddhism in China, contributed to the spread of Buddhism to Japan.
5Guangzhou, a major city in Southern China, is famed for its modern architecture and rich Cantonese heritage.
6Over centuries, China and Japan have had extensive cultural exchanges.
7Hokkaido, the northern island of Japan, is renowned for its stunning landscapes.
8In Tokyo, the technology sector, known for its innovation and advancement, collaborates with Chinese expertise, contributing to the shared progress of Japan and its global partners.
9Yokohama is the second largest city in Japan after Tokyo, with a population of 3.7 million people.
10Yokohama Chinatown, notable for being the largest Chinese enclave in Japan, boasts a wide array of Chinese restaurants known for their exquisite cuisine.
11Kyoto, once the capital of Japan, is celebrated for its historic temples and traditional culture.
12Kyoto, the ancient capital of Japan before Tokyo, is renowned for its rich historical and cultural heritage.
13Many temples and buildings in Kyoto were influenced by Chinese architecture.
14Tokyo is a bustling metropolis, while Kyoto is a serene historical haven, both embodying diverse charm of Japan.
Table 3. Examples of sentences from both datasets.
Table 3. Examples of sentences from both datasets.
CountryGH DatasetNH Dataset
ChinaMacau, an autonomous territory, uniquely blends its rich cultural heritage within China, showcasing a distinct yet harmonious identity.During Confucius’s lifetime, he traveled across various Chinese states, offering advice to rulers, which later formed the basis of Confucianism.
EgyptLake Nasser was created by the construction of the Aswan High Dam across the Nile River in southern Egypt in the 1960s.Osiris was one of the most important gods in ancient Egyptian religion, associated with kingship, death, and the afterlife.
GreeceGreece is known as the cradle of Western civilization, with a rich history that spans thousands of years.In Athens, the philosopher Socrates challenged traditional notions of ethics and wisdom, sparking intellectual revolutions across Greece.
IranTehran serves as the political, cultural, economic, and industrial center of IranOmar Khayyam’s contributions to mathematics and astronomy were highly regarded in cities like Nishapur, Isfahan, and Baghdad, where he studied and worked.
JapanYokohama is the second largest city in Japan after Tokyo, with a population of 3.7 million people.Miyazaki’s love for nature is evident in many of his films, drawing inspiration from the lush forests of Yakushima Island.
KazakhstanThe Irtysh is one of the longest rivers in Asia, flowing through China, Kazakhstan, and Russia.Abai, the great Kazakh poet, was born in the village located in the Semey region of Kazakhstan.
MongoliaThe Gandan Monastery, located in Ulaanbaatar, is one of Mongolia’s most important Buddhist monasteries and a center for religious and cultural activities.Subutai’s military genius made him one of the most feared and respected commanders of his time, leaving a legacy in Mongol and military history.
RussiaThe Volga River is the longest river in Europe, flowing through central Russia for over 3500 km.Turgenev’s masterpiece, “Fathers and Sons”, reflects the tensions between generations and the changing social landscape of 19th-century Russia.
TurkeyThe capital and second-largest city of Turkey is Ankara.Sultan Suleiman was born in 1494 in Trabzon, a city located on the northeastern coast of Turkey.
UzbekistanKhiva is an ancient city located in the western part of Uzbekistan, in the region of Khorezm.Khiva, located along the Silk Road, was a hub of trade and exchange, influencing Al-Khwarizmi’s understanding of geography and navigation.
Table 4. Datasets statistics.
Table 4. Datasets statistics.
CountryGH DatasetNH Dataset
Number of SentencesAverage Length of SentencesNumber of Terms OccurrencesNumber of Unique TermsNumber of SentencesAverage Length of SentencesNumber of Terms OccurrencesNumber of Unique Terms
China10020302851002016640
Egypt10021294581002211836
Greece10021283651002212354
Iran10017281661002217163
Japan10020235461001913135
Kazakhstan10017390621002214359
Mongolia10018360591002317457
Russia10026295721002115258
Turkey10017271571002016146
Uzbekistan10023436831002222647
Total1000-3147653/4611000-1183495/476
Note: The last row ‘total‘ and corresponding numbers are bold to highlight summary statistics.
Table 5. The top 10 words for the GH and NH datasets.
Table 5. The top 10 words for the GH and NH datasets.
GH DatasetNH Dataset
WordFrequencyWordFrequency
1City136Born159
2Located119City116
3Known115Ancient99
4River102One81
5Ancient99Known71
6One93Located58
7Region90Around52
8Sea90Chinese51
9Cultural88Legacy48
10Including79Kazakh48
Table 6. Seeds for semantic NMF.
Table 6. Seeds for semantic NMF.
Class (Country)GH DatasetNH Dataset
2 Seed Words per Class3 Seed Words per Class2 Seed Words per Class3 Seed Words per Class
ChinaChina, BeijingChina, Beijing, ShanghaiConfucius, MaoConfucius, Mao, Laozi
EgyptEgypt, CairoEgypt, Cairo, AlexandriaCleopatra, OsirisCleopatra, Osiris, Imhotep
GreeceGreece, AthensGreece, Athens, OlympusZeus, SocratesZeus, Socrates, Aristotle
IranIran, IsfahanIran, Tehran, IsfahanOmar, AvicennaOmar, Avicenna, Hafez
JapanJapan, TokyoJapan, Kyoto, TokyoToyoda, HokusaiToyoda, Hokusai, Hanyu
KazakhstanKazakh, AlmatyKazakh, Almaty, AstanaAbai, al-FarabiAbai, al-Farabi, Tomyris
MongoliaMongolia, UlaanbaatarMongolia, Ulaanbaatar, GobiChingis, ChagataiChingis, Chagatai, Kublai
RussiaRussia, MoscowRussia, Moscow, PetersburgPushkin, GagarinPushkin, Gagarin, Lomonosov
TurkeyTurkey, IstanbulTurkey, Istanbul, AnkaraSuleiman, ErdoganSuleiman, Erdogan, Ataturk
UzbekistanUzbek, TashkentUzbek, Tashkent, Samarkandal-Khwarizmi, Babural-Khwarizmi, Babur, Navoi
Table 7. Overview of experimental setups for semantic NMF.
Table 7. Overview of experimental setups for semantic NMF.
Setup Number   of   Topics   k Regularization λ Number   of   Extracted   Top   Words   T Number of SeedsUse of Anti-Seeds
110307020No
210307030No
310307020Yes
410307030Yes
Table 8. Results of baseline methods.
Table 8. Results of baseline methods.
DatasetBaseline MethodsNumber of Extracted WordsNumber of True TermsPrecisionRecallF1-Score
GHStandard NMF700/44046229.828.529.1
BERTopic700/49542.645.944.2
KeyBERT2000/6335271.560.2
NHStandard NMF700/48847619.119.519.3
BERTopic700/56825.730.728
KeyBERT2000/85344.980.557.6
Note: Best results are highlighted in bold.
Table 9. Results for each experimental setup of semantic NMF.
Table 9. Results for each experimental setup of semantic NMF.
DatasetSetupNumber of Extracted WordsNumber of True TermsPrecisionRecallF1-Score
GH1 (20 + no)700/40646277.868.773
2 (30 + no)700/4598079.879.9
3 (20 + yes)700/37184.46875.3
4 (30 + yes)700/45380.879.680.2
NH1 (20 + no)700/58547646.757.451.5
2 (30 + no)700/60948.161.654
3 (20 + yes)700/52651.957.454.5
4 (30 + yes)700/55152.560.756.3
Note: Best results are highlighted in bold.
Table 10. The best results of semantic NMF compared to the best results of KeyBERT.
Table 10. The best results of semantic NMF compared to the best results of KeyBERT.
ApproachGHNH
PrecisionRecallF1-ScorePrecisionRecallF1-Score
Semantic NMF80.879.680.247.477.758.9
KeyBERT5271.560.244.980.557.6
Standard NMF29.828.529.117.248.925.5
BERTopic42.645.944.222.349.230.7
Note: Best F1-Scores are highlighted in bold.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Nugumanova, A.; Alzhanov, A.; Mansurova, A.; Rakhymbek, K.; Baiburin, Y. Semantic Non-Negative Matrix Factorization for Term Extraction. Big Data Cogn. Comput. 2024, 8, 72. https://doi.org/10.3390/bdcc8070072

AMA Style

Nugumanova A, Alzhanov A, Mansurova A, Rakhymbek K, Baiburin Y. Semantic Non-Negative Matrix Factorization for Term Extraction. Big Data and Cognitive Computing. 2024; 8(7):72. https://doi.org/10.3390/bdcc8070072

Chicago/Turabian Style

Nugumanova, Aliya, Almas Alzhanov, Aiganym Mansurova, Kamilla Rakhymbek, and Yerzhan Baiburin. 2024. "Semantic Non-Negative Matrix Factorization for Term Extraction" Big Data and Cognitive Computing 8, no. 7: 72. https://doi.org/10.3390/bdcc8070072

Article Metrics

Back to TopTop