Skip to contents

Encoding text

Turn text into Sentence-BERT embeddings.

encode()
Encode Text with Sentence-BERT
pool()
Pool Token Embeddings into Sentence Embeddings

Models and runtime

Install the ONNX Runtime, download revision-pinned models, load custom Hugging Face exports, and manage the on-disk cache.

models()
List the Available Pinned Sentence-BERT Models
model_download()
Download a Pinned Sentence-BERT Model
load_model()
Load a Pinned Sentence-BERT Model
load_custom()
Load an Arbitrary Hugging Face Embedding Model
model_status()
Inspect an Installed Model
model_remove()
Remove an Installed Model from the Cache
install_runtime()
Install ONNX Runtime
cache_dir()
Locate the sbert Model Cache
cache_size()
Measure the sbert Cache

Preparing a corpus

Deduplicate, segment, and context-blend documents before modeling.

dedupe()
Deduplicate a Text Corpus with Frequencies
clean_corpus()
Clean a Text Corpus Before Encoding
strip_list_markers()
Strip Enumeration and List Markers from Text
content_ratio()
Alphabetic Content Ratio of Text
segment()
Segment Text into Sentences, Clauses, or Phrases
abbreviations()
Obtain the Built-in Abbreviation Gazetteer
blend()
Blend Segment Embeddings with Their Document Context
stop_words()
Obtain and Adjust the Topic Stop-Word List

Topic modeling

Fit topic models, sweep the topic count, and merge topics down.

topic_corpus()
Prepare a Corpus Once to Fit Many Topic Models
topics()
Discover Semantic Topics in Documents
select_topics()
Compare Topic Counts Before Committing to One
fitted(<sbert_topic_sweep>)
Extract One Fitted Model from a Topic-Count Sweep
reduce_topics()
Reduce a Fitted Topic Model to Fewer Topics

Describing topics

Distinctive terms, representative documents, sizes, and keywords.

terms(<sbert_topic_model>)
Topic Terms, Retuned Without Refitting
representatives()
Representative Text Units for Every Topic
topic_sizes()
Topic Sizes on the Distinct and Weighted Scales
keywords()
Extract Keywords from Documents by Embedding Similarity

Topic inference

Assign new documents and recover soft, generative, and mixed memberships.

predict(<sbert_topic_model>)
Assign New Documents to Fitted Topics
topic_membership()
Soft Topic Membership Probabilities
topic_gamma()
Document-Topic Distributions from Segment Assignments

Evaluating topics

Intrinsic coherence and topic diversity.

coherence()
Score Topic Coherence
topic_diversity()
Measure Topic Diversity

Visualizing and summarizing

Deterministic base-graphics plots, hierarchies, and reports.

summary(<sbert_topic_model>)
Summarize a Semantic Topic Model
plot(<sbert_topic_model>)
Plot a Semantic Topic Model
plot(<sbert_topic_sweep>)
Plot a Topic-Count Sweep
topic_hierarchy()
Build the Topic Hierarchy of a Fitted Model
topic_similarity()
Compute Cosine Similarity
topic_palette()
Qualitative Colour Palette for Topics

Data

Bundled corpora for offline examples and topic modeling.

feedback_translations
Levebee AI Mathematics Feedback with English Translations
covid
COVID-19 Research Abstracts