| pie_cat | R Documentation |
Fetches pages with collect_content() and passes their original HTML to piedomains
for extraction, tokenization, calibration and classification. The Python package must
be version 0.15.0 or newer. This uses its text classifier, not its image or fusion models.
pie_cat(domains = NULL, pages = NULL, threshold = 0.1, model = NULL, ...)
domains |
Character vector of domains or URLs. Supply either |
pages |
Data frame from |
threshold |
Finite probability in |
model |
Optional Hugging Face model ID or local checkpoint directory. Overrides
|
... |
Passed to |
A current fetch does not guarantee a correct current label. The shipped checkpoint
has known retail/drugs confusion; see its model card. Archive and cached content retain
their collection dates. details preserves the page and its fetch_* collection outcomes
separately from
the terminal classification status, stage, error_code and retryable columns.
A tibble following classification_results. Source-specific data are
retained in details; all source labels are retained in labels.
Install reticulate and declare Python requirements before initializing Python:
reticulate::py_require("piedomains==0.15.0", python_version = ">=3.12").
Set RETICULATE_PYTHON to select an existing Python environment.
Model weights download from Hugging Face on first use. The Python package pins its
default checkpoint; PIEDOMAINS_TEXT_MODEL can select another checkpoint or local path.
Results report the resolved model, revision when available, Python package version,
extractor, cleaning mode and calibration temperature.
## Not run:
pages <- collect_content(c("cnn.com", "wikipedia.org"))
pie_cat(pages = pages)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.