functionVerified releasev1
train_topic_model
Fit a simple TF-IDF and nonnegative matrix factorization topic model on supplied training titles only. Returns portable JSON vocabulary, IDF weights, learned components, automatic top-term names and a content identity; no rule-generated labels.
Interface
Verified contract
Inputs
| Name | Type |
|---|---|
| snapshot | dict |
| n_topics | int |
| min_documents | int |
| max_features | int |
| min_df | int |
| stop_words | list | None |
| random_state | int |
Outputs
| Name | Type |
|---|---|
| default | dict |
Exact release
Pinned local call
from spl import SPLClient
result = SPLClient.embedded().call(
"splime://@splime.project/case4-hn/train_topic_model@1",
kwargs={'max_features': 0, 'min_df': 0, 'min_documents': 0, 'n_topics': 0, 'random_state': 0, 'snapshot': {}, 'stop_words': []},
trust=True,
)Review before running. Public bundles contain executable code. Verify the publisher and exact content hash; a virtual environment isolates dependencies, not the operating system.
Evidence
Evidence-backed concepts
- Train topic model
- Portable JSON vocabulary
- Idf weights
- Learned components
- Content identity
- Fit tf idf
- Automatic top term names
- No rule generated labels
History
Public versions
- v13 downloads
Discover
Similar Objects
- evaluate_topics_temporallySplit HN stories chronologically, fit vocabulary and topics only on earlier titles, then inspect later-title coverage and reconstruction. No supervised accuracy or future-popularity forecast is claimed.
- tag_titlesAssign HN titles to topics with the immutable trained model embedded as a required native graph dependency. Automatic names use learned top terms; no caller model file or retraining. Returns hn-topics-v1 predictions.
- predict_topicsApply a supplied fitted HN topic model without fitting vocabulary or components. Returns topic assignments, automatic keyword tags, unknown-topic diagnostics and unchanged observed popularity values.
- hn_topic_digestFetch real HN stories, normalize them, apply the required immutable embedded trained model, count observed attention and render notebook-safe HTML. Training is a separate operation. Published implementation executes locally in embedded mode.
- analyze_titlesApply explicit topic rules and compare document shares in adjacent equal-duration windows. Counts describe the supplied snapshot, not all Hacker News activity.