df <- data.frame(
text = c("good product", "excellent", "loved it", "great quality",
"bad service", "terrible", "hated it", "awful experience",
"not good", "very bad", "fantastic", "wonderful"),
y = c("P", "P", "P", "P", "N", "N", "N", "N", "N", "N", "P", "P")
)
# Note: We use a small dataset here for demonstration.
# In real use cases, ensure you have more observations per class.
out <- pipeline("bow", "logit", df, "text", "y")
Run the code above in your browser using DataLab