Package: Rhobots 0.1.10

Rhobots: 'BERTopic'-Style Topic Modeling Without 'Python'

Implements the 'BERTopic' topic modeling pipeline directly in R: transformer-based sentence embedding, Uniform Manifold Approximation and Projection dimensionality reduction, Hierarchical Density-Based Spatial Clustering of Applications with Noise clustering, and class-based term frequency-inverse document frequency topic extraction - all without any dependency on 'Python', 'conda', or 'reticulate'. Every stage runs in R through 'torch', 'safetensors', 'tok', 'uwot', and 'dbscan'. The package mirrors the accessor API of the original 'Python' package, adds integrated quality metrics and hyperparameter search tools, and introduces part-of-speech filtered and C-value-ranked representation models.

Authors:J.P.G. van der Pol [aut, cre]

Rhobots_0.1.10.tar.gz
Rhobots_0.1.10.zip(r-4.7-x86_64)Rhobots_0.1.10.zip(r-4.7-arm64)Rhobots_0.1.10.zip(r-4.6-x86_64)Rhobots_0.1.10.zip(r-4.6-arm64)Rhobots_0.1.10.zip(r-4.5-x86_64)
Rhobots_0.1.10.tgz(r-4.6-x86_64)Rhobots_0.1.10.tgz(r-4.6-arm64)Rhobots_0.1.10.tgz(r-4.5-x86_64)Rhobots_0.1.10.tgz(r-4.5-arm64)
Rhobots_0.1.10.tar.gz(r-4.7-arm64)Rhobots_0.1.10.tar.gz(r-4.7-x86_64)Rhobots_0.1.10.tar.gz(r-4.6-arm64)Rhobots_0.1.10.tar.gz(r-4.6-x86_64)
Rhobots_0.1.10.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
Rhobots/json (API)

# Install 'Rhobots' in R:
install.packages('Rhobots', repos = c('https://jpvdp.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/jpvdp/rhobots/issues

Uses libs:
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

data-analysisnatural-language-processingtopic-modelingcpp

4.38 score 8 stars 7 scripts 264 downloads 68 exports 63 dependencies

Last updated from:2bbd92250a. Checks:15 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK154
linux-devel-x86_64OK187
source / vignettesOK230
linux-release-arm64OK188
linux-release-x86_64OK184
macos-release-arm64OK145
macos-release-x86_64OK273
macos-oldrel-arm64OK97
macos-oldrel-x86_64OK364
windows-devel-arm64OK249
windows-devel-x86_64OK191
windows-release-arm64OK243
windows-release-x86_64OK139
windows-oldrel-x86_64OK192
wasm-releaseOK153

Exports:agglomerative_clusteringapply_mmrbuild_dtmc_tf_idfclassify_textscls_poolcluster_docscompare_topicscvalue_representationcvalue_termsdim_projectdim_reduceembed_textsembed_texts_cachedfind_topicsfit_bertopicfit_topics_over_timeget_document_infoget_representative_docsget_stopwordsget_topicget_topic_infoget_topicsguided_fit_bertopichdbscan_clusteringhierarchical_topicskmeans_clusteringlabel_topics_llmload_bert_weightsload_bertopicload_cohere_embedderload_embeddingsload_hf_bertload_hf_classifierload_openai_embedderload_specter2load_stopwordsmake_wordpiece_tokenizermean_poolmerge_topicsno_reductionpca_reductionpos_dtmpos_representationprint_topicsreduce_outliersreduce_topicsrhobots_demorhobots_installsave_bertopicsave_embeddingsstability_analysissweep_topicstopic_coherencetopic_qualitytopics_over_timetransform_bertopicumap_reductionvisualize_barchartvisualize_comparisonvisualize_hierarchyvisualize_qualityvisualize_stabilityvisualize_sweepvisualize_topic_flowvisualize_topicsvisualize_topics_over_timezero_shot_topics

Dependencies:askpassBHbitbit64cachemcallrclicorocurldbscandescdigestdlrdqrngfarverfastmapfastmatchfilelockFNNfsgenericsgluehfhubhttrirlbajsonlitelabelinglatticelifecyclemagrittrMatrixmemoisemimeopensslotelpiecemakerprocessxpsR6rappdirsRColorBrewerRcppRcppAnnoyRcppEigenRcppProgressrlangRSpectrasafetensorsscalessitmostringistringrsystoktorchtriebeardurltoolsuwotvctrsviridisLitewithrwordpiecewordpiece.data

Readme and manuals

Help Manual

Help pageTopics
Agglomerative (hierarchical) clusteringagglomerative_clustering
Refine topic representations with Maximal Marginal Relevance (MMR)apply_mmr
Build a sparse document-term matrix from a character vectorbuild_dtm
Class-based TF-IDF (c-TF-IDF) for cluster-level topic termsc_tf_idf
Classify or label texts with a fine-tuned BERT-family modelclassify_texts classify_texts.default classify_texts.hf_classifier
CLS-token pooling: extract the CLS hidden state as the sentence vectorcls_pool
Fit a clustering model and return cluster labelscluster_docs
Compare topic prevalence across groupscompare_topics
Construct a C-value representation modelcvalue_representation
Compute C-value scores for candidate multi-word termscvalue_terms
Project new data using a fitted dimensionality-reduction modeldim_project
Fit a dimensionality-reduction model and return the reduced matrixdim_reduce
Compute or load document embeddings from a cache fileembed_texts_cached
Embed a vector of texts to a numeric matrixembed_texts embed_texts.api_embedder embed_texts.bert_encoder embed_texts.default
Find topics most similar to a search termfind_topics
Fit a BERTopic-style topic modelfit_bertopic
Fit independent BERTopic models per time period and align topicsfit_topics_over_time
Get document-level topic assignments as a data frameget_document_info
Get representative documents for one or all topicsget_representative_docs
Return the built-in stopword list for a languageget_stopwords
Get term-score representation for a single topicget_topic
Get topic-level metadata as a data frameget_topic_info
Get all topic-term representationsget_topics
Guided topic modeling with user-supplied seed wordsguided_fit_bertopic
HDBSCAN clusteringhdbscan_clustering
Build a hierarchical topic tree from a fitted topic modelhierarchical_topics
K-means clusteringkmeans_clustering
Label topics using a large language modellabel_topics_llm
Load BERT weights from a checkpoint into a constructed modelload_bert_weights
Load a previously saved BERTopic modelload_bertopic
Load a Cohere embedding modelload_cohere_embedder
Load an embedding matrix from diskload_embeddings
Load a BERT-family model from HuggingFace for use in Rload_hf_bert
Load a fine-tuned BERT-family classifier from HuggingFaceload_hf_classifier
Load an OpenAI embedding modelload_openai_embedder
Load a SPECTER2 model with a task-specific adapterload_specter2
Load a stopword list from a character vector, data frame, or fileload_stopwords
Create a WordPiece tokenizer for BERT models that lack 'tokenizer.json'make_wordpiece_tokenizer
Mean-pool token-level hidden states into a sentence vectormean_pool
Manually merge a set of topics into onemerge_topics
Skip dimensionality reduction (identity pass-through)no_reduction
PCA dimensionality reductionpca_reduction
Build a POS-filtered document-term matrixpos_dtm
Construct a POS-based representation modelpos_representation
Predict topics for new documents using a fitted BERTopic modelpredict.bertopic_fit
Pretty-print discovered topicsprint_topics
Print method for bert_encoder objectsprint.bert_encoder
Print method for bertopic_fit objectsprint.bertopic_fit
Print method for bertopic_flow objectsprint.bertopic_flow
Print method for hf_classifier objectsprint.hf_classifier
Reassign noise documents to the nearest real topicreduce_outliers
Reduce the number of topics by iteratively merging the most similar pairreduce_topics
Run a quick Rhobots demo using classic novels from Project Gutenbergrhobots_demo
Check Rhobots system dependencies and print setup instructionsrhobots_install
Save a fitted BERTopic model to disksave_bertopic
Save an embedding matrix to disksave_embeddings
Measure topic stability across multiple random seedsstability_analysis
Sweep BERTopic hyperparameters and compare topic qualitysweep_topics
Compute lexical coherence for discovered topicstopic_coherence
Evaluate topic quality for a fitted BERTopic modeltopic_quality
Compute how topic representations change over timetopics_over_time
Predict topics for new documents (standalone alias)transform_bertopic
UMAP dimensionality reductionumap_reduction
Bar charts of top terms per topicvisualize_barchart
Interactive heatmap of topic - group associationsvisualize_comparison
Visualise the hierarchical topic tree as a dendrogramvisualize_hierarchy
Visualise topic quality metricsvisualize_quality
Interactive heatmap of pairwise ARI scoresvisualize_stability
Visualise the results of a parameter sweepvisualize_sweep
Sankey diagram of topic flow across periodsvisualize_topic_flow
Visualise documents in topic spacevisualize_topics
Visualise topic frequency over timevisualize_topics_over_time
Zero-shot topic modeling with user-defined topic labelszero_shot_topics