Learn R Programming

text2emotion (version 0.1.0)

Emotion Analysis and Emoji Mapping for Text

Description

Allows users to analyze text and classify emotions such as happiness, sadness, anger, fear, and neutrality. It combines text preprocessing, TF-IDF (Term Frequency-Inverse Document Frequency) feature extraction, and Random Forest classification to predict emotions and map them to corresponding emojis for enhanced sentiment visualization.

Copy Link

Version

Install

install.packages('text2emotion')

Monthly Downloads

89

Version

0.1.0

License

GPL-2

Maintainer

Fangyi Wang

Last Published

May 12th, 2025

Functions in text2emotion (0.1.0)

train_full_model

Train a full model pipeline including text preprocessing, TF-IDF vectorization, random forest tuning, and training.
preprocess_text

Preprocess Text with Slang Handling
predict_emotion_with_emoji

Predict Emotion with Emoji Representation
evaluate_rf_model

Evaluate a Random Forest Model on Test Data
handle_negation

Handle Negation in Token List
train_rf_model

Train a Random Forest Model with TF-IDF Features
train_tfidf_model

Train a TF-IDF Model (for Training Phase)
tune_rf_model

Tune Random Forest Model Hyperparameters