Changelog
Source:NEWS.md
layaR (development version)
-
laya_annotate()gainsanswer_confidence, which adds an<id>_answer_confidencecolumn: the confidence in the answer given (for a choice question, the chosen option’s probability), the numbermin_confidencecompares with its threshold. -
laya_annotate()explains thatstatetakes column names as strings when given bare names (state = c(subject, body)), instead of failing with “object not found”. - New website article, “Using layaR with the tidyverse”, showing the data-frame workflows with dplyr, tidyr, purrr and ggplot2.
layaR 0.1.0
First release. layaR runs Laya decision models locally from R through the laya-onnx Rust crate and ONNX Runtime.
Questions and predictions
-
laya_choice(),laya_score()andlaya_noul()build typed questions;laya_questions()combines them.laya_preset()gives the Python SDK’s five presets (triage, email, guard, moderation, router). -
laya_predict()answers every question about a state in one forward pass;laya_predict_batch()does it for many states, in interruptible chunks with a progress bar;laya_predict_long()scans documents longer than the model’s context. -
laya_predict_batch()sends one state per forward pass by default, which is fastest on a CPU (unlike the Python SDK, which batches a whole chunk). ThelayaR.batch_sizeoption changes the default;?layaRlists all options. -
min_confidencereports, per answer, whether it passed an abstention threshold. - Results print compactly and convert with
as.data.frame()andlaya_probabilities(); they keep the Python SDK’s shape. -
laya_annotate()adds the answers to a data frame as columns: a factor for choice questions, the expected level for scores, P(true) for yes/no questions. - Question sets read and write the Python SDK’s JSON format (
as_laya_questions(),laya_questions_to_json()).
Models
-
laya_download_model()downloads ONNX exports from Hugging Face (gueyenono/laya-onnxby default), resumably. -
laya_import_model()adds an export you made yourself;laya_models(),laya_remove_model()andlaya_model_root()manage them. Exports in the cache shared with Laya’s Rust and TypeScript SDKs are found too. -
laya_engine()loads a checkpoint (multilingual, English or typed-decisions); the prediction functions uselaya_default_engine(). Engines refuse to run afterfork()instead of hanging, and reconnect aftersaveRDS()or in PSOCK workers.
Text utilities
-
laya_detect_language(),laya_clean_email()andlaya_email_state(), ported from the Python SDK. They need no model.