Package: openalexVectorComp 0.3.6

Rainer M Krug

openalexVectorComp: Embedding Vectorization and Distance-Based Scoring Workflows

R-first orchestration for text vectorization (embeddings), embedding distance computation, and distance-based scoring workflows. Supports backend-neutral embedding providers (HF, OpenAI, TEI), prototype cosine-distance scoring, reference-area distance scoring, and threshold calibration utilities.

Authors:Rainer M Krug [aut, cre]

openalexVectorComp_0.3.6.tar.gz
openalexVectorComp_0.3.6.zip(r-4.7-any)openalexVectorComp_0.3.6.zip(r-4.6-any)openalexVectorComp_0.3.6.zip(r-4.5-any)
openalexVectorComp_0.3.6.tgz(r-4.6-any)openalexVectorComp_0.3.6.tgz(r-4.5-any)
openalexVectorComp_0.3.6.tar.gz(r-4.7-any)openalexVectorComp_0.3.6.tar.gz(r-4.6-any)
openalexVectorComp_0.3.6.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
openalexVectorComp/json (API)

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

Bug tracker:https://github.com/openalexpro/openalexvectorcomp/issues

Pkgdown/docs site:https://openalexpro.github.io

On CRAN:

Conda:

quarto

4.50 score 25 exports 51 dependencies

Last updated from:ca5f168e13 (on main). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK176
source / vignettesOK243
linux-releaseOK188
macos-releaseOK211
macos-oldrelOK175
windows-develOK194
windows-releaseOK207
windows-oldrelOK170
wasm-releaseOK119

Exports:backend_configbackend_embed_textsbackend_infobackend_readbackend_savebackend_specter2_teibatch_collect_openaibatch_status_openaibatch_submit_openaicalibrate_thresholdclean_abstract_for_embeddingdemo_finalize_openai_batchdistance_cosinedistance_reference_cosinedistance_ridgeembed_corpusembed_textsfit_ridgeplot_embeddings_pcaplot_embeddings_umaprun_demo_openairun_demo_openalexscore_reference_cosinescore_ridgesimilarity_cosine

Dependencies:arrowaskpassassertthatBHbitbit64clicpp11curldigestdplyrdqrngfarverFNNgenericsggplot2gluegtablehttr2irlbaisobandjsonlitelabelinglatticelifecyclemagrittrMatrixopensslpillarpkgconfigpurrrR6RColorBrewerRcppRcppAnnoyRcppEigenRcppProgressrlangRSpectraS7scalessitmosystibbletidyselectutf8uwotvctrsviridisLitewithryaml

specter2-setup
Why SPECTER2 for academic papers | One-time setup | Python environment | Run the merge script | Serving via TEI | Verify | Using from R | Smoke test | Where this fits | Notes

Last update: 2026-06-03
Started: 2026-06-03

backend-architecture
Purpose | File Structure | High-Level Backend Flow | End-to-End Call Order in embed_corpus() | Data Contract | Input dataset expected by embed_corpus() | Canonical text construction | Output columns per embedded row | Shared Backend Rules | Authentication Model | Provider Responsibilities | Hugging Face (provider = "hf") | OpenAI (provider = "openai") | TEI (provider = "tei") | Function Examples | 1) HF backend (default-style) | 2) OpenAI backend | 3) Local TEI backend | How to Add a New Backend | Step 1: add dispatch entry in core | Step 2: create provider file | Step 3: enforce adapter contract | Step 4: docs and validation | Operational Flowchart for embed_corpus() | Troubleshooting | 401 / 403 from provider API | Row mismatch errors | Model metadata unavailable (dim = NA)

Last update: 2026-04-01
Started: 2026-03-15

openai-batch-async
Why this workflow exists | OpenAI vs OpenAlex (important) | Lifecycle | Prerequisites | Step 1: Submit jobs | What preflight checks do | Where state is written | Step 2: Check status | Interpreting status values | Step 3: Collect completed jobs | Output compatibility guarantee | Common pitfalls and what to check | 1) Authentication failures (401) | 2) Single oversized records | 3) Duplicate submission risk | 4) Concurrent collectors | 5) Confusing labels | Data retention and expiry (OpenAI) | Recommended operating pattern | Monitoring checklist | References

Last update: 2026-04-01
Started: 2026-03-17

package-overview
Purpose | Package Philosophy | Function Groups | 1) Embedding backend abstraction | 2) Corpus embedding orchestration | 3) Text preparation | 4) Similarity and distance | 5) Supervised scoring and calibration | 6) Embedding-space visualization | Canonical Workflow | Data and Storage Model | Corpus input | Embeddings output | Dry-run output | Text-Preparation Contract | Why this contract matters | Decision Model: Geometric + Supervised | Minimal End-to-End Example | Operational Guidance | Related Vignettes | Summary

Last update: 2026-04-01
Started: 2026-03-15

simplestart
Introduction | Requirements | Notes on execution | TEI endpoint | Embed a small corpus | Compute prototype distances | Compute ridge distances and scores | Troubleshooting | Reproducibility

Last update: 2026-04-01
Started: 2026-01-12

tei-server-operations
Purpose | Start TEI | Local binary | Alternative port | Verify service | Health | Info | Embed smoke test | Use TEI endpoint in package | Process management (shell) | Recommended production pattern | Troubleshooting | Port already in use | Empty/invalid responses | Slow throughput

Last update: 2026-04-01
Started: 2026-03-15

abstract-cleaning
Purpose | Where Cleaning Happens | Cleaner Contract | Cleaning Pipeline (Step by Step) | Cleaning Flow Diagram | Why These Rules | Mode Behavior (lenient, balanced, strict) | Example: Default Cleaning | Example: Before/After on Individual Cases | Example: Change Missing-Abstract Policy | Example: Use a Stricter Cleaning Configuration | Using Custom Patterns | Integration with embed_corpus() | Preprocessor Validation in embed_corpus() | Output Provenance and Auditability | Recommended Operational Defaults | Summary

Last update: 2026-03-15
Started: 2026-03-15

Readme and manuals

Help Manual

Help pageTopics
Build embedding backend configurationbackend_config
Embed texts via configured backendbackend_embed_texts
Get embedding backend model/service informationbackend_info
Read backend configuration from YAMLbackend_read
Save backend configuration to YAMLbackend_save
Backend preset for a local TEI server serving the merged SPECTER2 proximity modelbackend_specter2_tei
Collect completed OpenAI batch embedding jobsbatch_collect_openai
Inspect OpenAI batch state for a labelbatch_status_openai
Submit OpenAI Batch jobs for corpus embeddings (asynchronous)batch_submit_openai
Calibrate threshold from Parquet scores by streaming batchescalibrate_threshold
Clean title/abstract rows into embedding-ready textclean_abstract_for_embedding
Finalize OpenAI demo batch jobs and compare direct vs batch embeddingsdemo_finalize_openai_batch
Cosine distance between two numeric vectorsdistance_cosine
Pairwise cosine distances with centroid axis between label partitionsdistance_reference_cosine
Compute corpus distance to a reference embedding areadistance_ridge
Join prototype and ridge distances lazily via Arrowdistances
Stream a corpus dataset, embed in batches, and write Parquetsembed_corpus
Embed texts through a configured backendembed_texts
Fit a reference-area model from embeddings parquetfit_ridge
Plot embeddings via PCA, colored by arbitrary labelsplot_embeddings_pca
Plot embeddings via UMAP, colored by arbitrary labelsplot_embeddings_umap
Create and optionally run an OpenAI-based demo project via Quartorun_demo_openai
Create and optionally run a self-contained demo project via Quartorun_demo_openalex
Convert reference-cosine distances to scoresscore_reference_cosine
Convert ridge distances to ridge scoresscore_ridge
Cosine similarity between two numeric vectorssimilarity_cosine