Semi-supervised NMF Topic Model

Machine Learning
Introduced by
Lee & Seung (NMF); semi-supervised extensions by Jagarlamudi et al. and others
Year
2001 (NMF); semi-supervised variants from ~2010s
Type
Matrix factorization with supervision
Family
Deep learning / NLP / CV

What does it do?

Semi-supervised Non-negative Matrix Factorization (NMF) topic modeling refers to a family of approaches that extend unsupervised NMF with user-provided seed words or label information, steering the discovered topics toward themes the analyst cares about.

A document-term matrix is factorized into non-negative components while a constraint or penalty encourages designated words to load on designated topics. The result is a set of topics anchored to known vocabulary, with the remainder of each topic still derived from the corpus.

The intuition behind the method

Unsupervised NMF finds topics by decomposing a word-count matrix into parts-based patterns, but the resulting topics may not align with the concepts that matter to the analyst. Semi-supervised NMF lets users inject domain knowledge, such as seed words like 'tax', 'revenue' and 'fiscal' for an economics topic, as soft or hard constraints that nudge the factorization in a chosen direction. The algorithm then fills in the rest of each topic from the data, balancing analyst guidance against corpus-driven discovery. This is most useful when labeled documents are scarce but expert vocabulary is available.

History

Non-negative matrix factorization is associated with Lee and Seung, whose 2001 paper presents algorithms for it as a parts-based decomposition. Semi-supervised and seed-guided variants were later developed by various research groups seeking to add lexical priors to topic models without full annotation, and no single publication defines the approach. Jagarlamudi, Daumé and Udupa (2012) studied lexical priors in topic models; their work concerns LDA-type models rather than NMF, so it is a related precedent rather than the origin of this NMF variant.

When to use it

Choose semi-supervised NMF when you have a corpus of reasonable size, domain expertise that can be written as seed word lists, and a need for interpretable topics anchored to known themes. It suits settings where labeled documents are scarce but expert vocabulary exists, such as policy analysis, medical record mining or product review categorization. Do not use it if no topics or seed vocabulary are known; fully unsupervised LDA or NMF is the better starting point then. If per-document labels are abundant, a supervised classifier is usually more appropriate. Avoid very short texts such as microblog posts, because the document-term matrix becomes too sparse for reliable factorization.

Limitations and considerations

  • Quality depends heavily on seed word selection; poorly chosen seeds can distort several discovered topics at once.
  • Constraint enforcement mechanisms differ across implementations, which makes results hard to reproduce across software packages.
  • NMF does not model document-topic proportions probabilistically, which limits uncertainty quantification compared with LDA-based semi-supervised models.
  • The number of topics k must be specified by the analyst and is usually validated heuristically.
  • Short documents yield sparse rows in the document-term matrix, which gives the factorization little evidence per document.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Lets domain knowledge enter the model without requiring fully labeled documents, sitting between unsupervised discovery and supervised classification.
  • Non-negative factors give additive, parts-based topics: each topic is a set of terms with non-negative weights, so there are no negative word weights to explain.
  • Seed words are a form of guidance that domain experts can write without machine-learning training.
  • The seed lists give a concrete reference point for checking whether the discovered topics honoured the guidance.

Applications

  • Policy document analysis where key policy themes are known but labeled corpora are unavailable.
  • Clinical text mining using established medical term seeds to surface diagnosis-related topics.
  • Product review categorization guided by pre-defined attribute seed words (price, quality, service).
  • Academic literature mapping with discipline-specific seed vocabularies.
  • Social-media content analysis for predefined issue categories, restricted to longer texts such as articles or long posts; very short microblog posts are unsuitable.

How it works

How it works

1

The text corpus is preprocessed (tokenization, stop-word removal and, optionally, TF-IDF weighting) and converted into a document-term matrix V with one row per document and one column per vocabulary term. This matrix is the input to factorization.

2

Seed words or partial label information are encoded as constraints on the factor matrices. This page describes a family of approaches rather than one published algorithm: fixing or boosting seed-word entries in the topic-word factor, adding a regularization term that pulls seed words toward designated topics, or initializing the factors with prior knowledge. The analyst must specify which form is used and, for penalty-based forms, the parameter that controls constraint strength.

3

V is approximated by the product of two non-negative factor matrices, with the number of topics k as their shared inner dimension. The fit minimizes a reconstruction loss, typically the Frobenius norm or KL divergence, subject to non-negativity and the injected constraints. Lee and Seung's multiplicative update rules are the standard solver for the unconstrained problem, and constrained variants often adapt them.

Formula
V \approx W H,\quad W,H \geq 0
4

Depending on the variant, the constraint mechanism is applied again after each update: seed-word weights are pulled back toward their designated topics, or hard constraints are projected onto the feasible set. Repeating this step keeps the unconstrained NMF updates from overriding the supervision signal.

5

Each document is assigned to its dominant topic using the topic weights the factorization gives it. Topics are labeled by inspecting the highest-weight terms in the corresponding topic-word weights. The analyst can compare these top terms with the original seed words to judge how well the guidance was honoured.

Common pitfalls

  • Choosing seed words that are too general (for example 'data' or 'study'). Seeds must be discriminative to steer topics meaningfully.
  • Skipping adequate preprocessing (stop words, rare terms) before factorization, which can inflate noise topics.
  • Fixing too many seed constraints relative to the corpus vocabulary, which can produce over-constrained solutions that ignore corpus evidence.
  • Judging topics only by internal coherence scores without checking them against domain relevance with experts.
  • Confusing semi-supervised NMF with standard NMF and omitting a description of the constraint mechanism when reporting methods.

Frequently asked questions

How many seed words do I need per topic?

No validated threshold is established. As a practitioner heuristic, a small set of highly discriminative seed words per topic is the usual aim. Too few give weak guidance, while many generic or overlapping seeds can over-constrain the factorization and suppress corpus-driven patterns.

How is semi-supervised NMF different from semi-supervised LDA?

Both inject lexical priors, but NMF is a matrix decomposition that minimizes a reconstruction loss, whereas LDA is a probabilistic generative model with Dirichlet priors. NMF is often simpler to compute, and its factors are easy to inspect, but it lacks LDA's probabilistic uncertainty quantification.

Do I need any labeled documents?

Not necessarily. The most common form of supervision is seed word lists rather than labeled documents. Some variants accept a small set of labeled documents to additionally constrain the document-topic weights.

How do I choose the number of topics k?

There is no universally correct method. A common practitioner approach is to compare coherence scores across a range of candidate values, inspect how the reconstruction error changes with k, and review the top words of each topic with domain experts.

Can semi-supervised NMF handle multilingual corpora?

Yes, if the document-term matrix is built from a multilingual vocabulary and seed words are supplied in all relevant languages. Cross-lingual alignment is not built in, so dedicated multilingual topic models or cross-lingual embedding methods may be more appropriate for strongly multilingual corpora.

Related methods

Sources

  1. Lee, D. D., & Seung, H. S. (2001). Algorithms for non-negative matrix factorization. Advances in Neural Information Processing Systems, 13, 556–562.

    Open publication reference
  2. Jagarlamudi, J., Daume, H., & Udupa, R. (2012). Incorporating lexical priors into topic models. Proceedings of the 13th Conference of the European Chapter of the Association for Computational Linguistics (EACL 2012), 204–213.

    Open publication reference