Learn R Programming

quickSentiment (version 0.1.0)

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.

Examples

Run this code
# \donttest{
preds <- prediction(my_artifacts, c("cleaned text one", "cleaned text two"))
# }

Run the code above in your browser using DataLab