View source: R/datasets_findingemo.R
| load_findingemo_annotations | R Documentation |
Loads and preprocesses annotations from a downloaded FindingEmo-Light dataset. Returns a clean R data.frame with emotion annotations, valence/arousal scores, and associated metadata.
load_findingemo_annotations(
data_dir,
output_format = c("dataframe", "list"),
python_path = NULL
)
data_dir |
Character. Directory containing the downloaded FindingEmo data. |
output_format |
Character. Format for processed data: "dataframe" returns R data.frame, "list" returns full processed data (default: "dataframe"). |
python_path |
Character. Path to Python executable (optional). |
This function loads the CSV annotation file and JSON URLs file from a downloaded FindingEmo dataset, performs basic validation and preprocessing, and returns the data in a format suitable for emotion analysis.
The function handles missing values, validates valence/arousal ranges, and provides summary statistics for the loaded data.
If output_format = "dataframe": A data.frame with columns:
image_id: Unique image identifier
valence: Valence score (emotion positivity)
arousal: Arousal score (emotion intensity)
Additional columns as present in the dataset
If output_format = "list": A list containing:
annotations: Data.frame with annotation data
urls: List with image URL information
metadata: List with dataset metadata
download_findingemo_data, prepare_findingemo_evaluation
## Not run:
# Download dataset first
download_result <- download_findingemo_data("./findingemo_data")
if (download_result$success) {
# Load annotations as data.frame
annotations <- load_findingemo_annotations("./findingemo_data")
# Examine the data
head(annotations)
summary(annotations)
# Get full processed data including metadata
full_data <- load_findingemo_annotations(
data_dir = "./findingemo_data",
output_format = "list"
)
print(full_data$metadata)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.