prediction: Predict Sentiment on New Data Using a Saved Pipeline Artifact
Description
This is a generic prediction function that handles different model types
and ensures consistent preprocessing and vectorization for new, unseen text.
Usage
prediction(pipeline_object, df, text_column)
Value
A vector of class predictions for the new data.
Arguments
pipeline_object
A list object returned by the main `pipeline()` function.
It must contain the trained model, DFM template, preprocessing function,
and n-gram settings.
df
A data frame containing the new data.
text_column
A string specifying the column name of the text to predict.