A Fast and Flexible Pipeline for Text Classification
Overview
A high-level pipeline that simplifies text classification into three streamlined steps: preprocessing, model training, and standardized prediction. It unifies the interface for multiple algorithms (including 'glmnet', 'ranger', 'xgboost', and 'naivebayes') and memory-efficient sparse matrix vectorization methods (Bag-of-Words, Term Frequency, TF-IDF, and Binary). Users can go from raw text to a fully evaluated sentiment model, complete with ROC-optimized thresholds, in just a few function calls. The resulting model artifact automatically aligns the vocabulary of new datasets during the prediction phase, safely appending predicted classes and probability matrices directly to the user's original dataframe to preserve metadata.
MAJOR ARCHITECTURAL UPGRADES
Fault-Tolerant Text Preprocessing: Completely rebuilt pre_process() to ensure pipeline resilience on massive, messy datasets. The function now uses a chunked processing architecture (default chunk_size = 5000). If a malformed string crashes a chunk, the function automatically degrades to row-by-row isolation for that specific block, neutralizing the corrupted string to NA_character_ and seamlessly resuming C++ vectorized speed for the rest of the dataset.
The Quarantine Attribute: When pre_process() isolates a fatal text encoding or parsing error, it now attaches a quarantine dataframe as an attribute to the output vector (attr(cleaned_vector, "quarantine")). This allows production pipelines to log the exact row_index, original_text, and error_message of failed rows without halting the overarching R session.
NEW FEATURES
Advanced Memory Management: Exposed the chunk_size argument in pre_process(), allowing advanced users to optimize the speed-to-memory trade-off based on their specific hardware and data quality.
Automated Data Sanitization: The main pipeline() function now safely detects and simultaneously drops NA values in both the text vector and sentiment label vectors prior to training, preventing downstream failures caused by quarantined text rows.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 14
- Examples that run
- 56%5 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran) · 3 never run
- Exported functions with examples
- 82%
- Documented parameters
- 100%
- Return-value docs
- 91%
- Help pages citing references
- 0%
Downloads
Dependencies
Installing quickSentiment adds 57 packages (29 with compiled code, 52 MB of source tarballs). Heaviest: stringi 11 MB, data.table 5.7 MB, quanteda 4.2 MB.
CRAN will archive these unless their check problems are fixed by the date shown. This package needs each one to install.
- quantedafix by Oct 22
Code & Tests
Datasets
People & History
Package metadata
- First published
- 2026-02-06
- Total releases
- 8 / 1 yrs
- License
- MIT + file LICENSE OSI
- Download size
- 89 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("quickSentiment")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.