predict_emotion_with_emoji {text2emotion} | R Documentation |
Predict Emotion with Emoji Representation
Description
This function takes input text, preprocesses it, extracts TF-IDF features using a pre-trained model, predicts the emotion using a trained classifier, and returns the result with optional emoji representation.
Usage
predict_emotion_with_emoji(text, output_type = "textemoji")
Arguments
text |
Character string containing the text to analyze. |
output_type |
Type of output to return. Must be one of:
|
Value
Depending on output_type:
For "emotion": character string of predicted emotion
For "emoji": character string of corresponding emoji
For "textemoji": original text with appended emoji
The function also prints the result to console.
Examples
## Not run:
# This example is not run because it requires manually downloading
# a large external model (~30MB), which cannot be retrieved automatically
# and may fail in offline environments.
predict_emotion_with_emoji("I'm so happy today!")
predict_emotion_with_emoji("This makes me angry", "emoji")
predict_emotion_with_emoji("I feel scared", "emotion")
## End(Not run)
[Package text2emotion version 0.1.0 Index]