diff --git a/DESCRIPTION b/DESCRIPTION index 0111583..d824dce 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,9 +6,9 @@ Authors@R: c(person("Alexander", "Christensen", email = "alexpaulchristensen@gma role = "aut", comment = c(ORCID = "0000-0002-9798-7037")), person("Hudson", "Golino", email = "hfg9s@virginia.edu", role = "aut", comment = c(ORCID = "0000-0002-1601-1447")), - person("Aleksandar", "Tomašević", email = "atomashevic@gmail.com", role = c("aut", "cre"), + person("Aleksandar", "Tomasevic", email = "atomashevic@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-4863-6051"))) -Maintainer: Aleksandar Tomašević +Maintainer: Aleksandar Tomasevic Description: Implements sentiment analysis using huggingface transformer zero-shot classification model pipelines for text and image data. The default text pipeline is Cross-Encoder's DistilRoBERTa and default image/video pipeline is Open AI's CLIP . All other zero-shot classification model pipelines can be implemented using their model name from . License: GPL (>= 3.0) Encoding: UTF-8 diff --git a/R/dlo.R b/R/dlo.R index 56b9191..27a824e 100644 --- a/R/dlo.R +++ b/R/dlo.R @@ -25,7 +25,7 @@ #' @return A numeric vector containing the updated derivative of the state. #' #' @references -#' Ollero, M. J. F., Estrada, E., Hunter, M. D., & Cáncer, P. F. (2023). +#' Ollero, M. J. F., Estrada, E., Hunter, M. D., & Cancer, P. F. (2023). #' Characterizing affect dynamics with a damped linear oscillator model: Theoretical considerations and recommendations for individual-level applications. #' \emph{Psychological Methods}. #' \doi{10.1037/met0000615} diff --git a/R/image_scores.R b/R/image_scores.R index 985f6ef..5238a8f 100644 --- a/R/image_scores.R +++ b/R/image_scores.R @@ -10,7 +10,7 @@ #' @param face_selection The method to select the face in the image. Can be "largest" or "left" or "right". Default is "largest" and will select the largest face in the image. "left" and "right" will select the face on the far left or the far right side of the image. Face_selection method is irrelevant if there is only one face in the image. #' @return A data frame containing the scores for each class. #' -#' @author Aleksandar Tomašević +#' @author Aleksandar Tomasevic #' @importFrom reticulate source_python #' @importFrom reticulate py #' @export diff --git a/R/rag.R b/R/rag.R index e450454..f38d09c 100644 --- a/R/rag.R +++ b/R/rag.R @@ -1,6 +1,6 @@ #' Retrieval-augmented Generation (RAG) #' -#' @description Performs retrieval-augmented generation using {llama-index} +#' @description Performs retrieval-augmented generation \{llama-index\} #' #' Currently limited to the TinyLLAMA model #' @@ -19,7 +19,7 @@ #' #' \describe{ #' -#' \item{"LLAMA-2"}{The largest model available (13B parameters) but also the most challenging to get up and running for Mac and Windows. Linux operating systems run smooth. The challenge comes with installing the {llama-cpp-python} module. Currently, we do not provide support for Mac and Windows users} +#' \item{"LLAMA-2"}{The largest model available (13B parameters) but also the most challenging to get up and running for Mac and Windows. Linux operating systems run smooth. The challenge comes with installing the \{llama-cpp-python\} module. Currently, we do not provide support for Mac and Windows users} #' #' \item{"Mistral-7B"}{Mistral's 7B parameter model that serves as a high quality but more computationally expensive (more time consuming)} #' @@ -396,6 +396,13 @@ get_embedding <- function(index, output) # Loop across documents embedding <- do.call(cbind, lapply(output$content$document, index$vector_store$get)) +### AT: Content and n_documents are not defined within the function +### temp fix for CRAN checks, August 20 2024 + # content + content <- output$content + # n_documents + n_documents <- nrow(content) + # Initialize data frame content_df <- matrix( data = NA, nrow = n_documents, ncol = 3, diff --git a/R/setup_gpu_modules.R b/R/setup_gpu_modules.R index 0b24d9b..034a913 100644 --- a/R/setup_gpu_modules.R +++ b/R/setup_gpu_modules.R @@ -1,6 +1,6 @@ #' Install GPU Python Modules #' -#' @description Installs GPU modules for the {transforEmotion} conda environment +#' @description Installs GPU modules for the \{transforEmotion\} conda environment #' #' @details Installs modules for miniconda using \code{\link[reticulate]{conda_install}} #' diff --git a/R/setup_miniconda.R b/R/setup_miniconda.R index 36d436c..3dacc38 100644 --- a/R/setup_miniconda.R +++ b/R/setup_miniconda.R @@ -21,7 +21,7 @@ conda_check <- function(){ #' @details Installs miniconda using \code{\link[reticulate]{install_miniconda}} and activates the transforEmotion environment using \code{\link[reticulate]{use_condaenv}}. If the transforEmotion environment does not exist, it will be created using \code{\link[reticulate]{conda_create}}. #' #' @author Alexander P. Christensen -#' Aleksandar Tomašević +#' Aleksandar Tomasevic #' #' @export #' diff --git a/R/setup_modules.R b/R/setup_modules.R index f03ce2e..2b6ed60 100644 --- a/R/setup_modules.R +++ b/R/setup_modules.R @@ -1,6 +1,6 @@ #' Install Necessary Python Modules #' -#' @description Installs modules for the {transforEmotion} conda environment +#' @description Installs modules for the \{transforEmotion\} conda environment #' #' @details Installs modules for miniconda using \code{\link[reticulate]{conda_install}} #' diff --git a/R/video_scores.R b/R/video_scores.R index f122f1c..6df705e 100644 --- a/R/video_scores.R +++ b/R/video_scores.R @@ -17,7 +17,7 @@ #' #' @return A result object containing the analyzed video scores. #' -#' @author Aleksandar Tomašević +#' @author Aleksandar Tomasevic #' @import reticulate #' #' @export diff --git a/inst/CITATION b/inst/CITATION index 69bb336..fb357c6 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,17 +1,18 @@ citHeader("To cite transforEmotion in publications use:") bibentry( - bibtype = "manual", - key = "transforEmotion", - title = "transforEmotion: Sentiment analysis for text, image and video using transformer models", - author = c(person("Christensen,", "Alexander P"), - person("Golino,", "Hudson"), - person("Tomasević","Aleksandar")), - year = "2024", - note = "R package version 0.1.4", - - textVersion = - paste0("Christensen, A. P., Golino, H., Tomašević, A. (2024). ", - "transforEmotion: Sentiment analysis for text, image and video using transformer models.", - "R package version 0.1.4.") -) + bibtype = "Article", + key = "tomasevic2024decodi", + title = "Decoding emotion dynamics in videos using dynamic Exploratory Graph Analysis and zero-shot image classification: A simulation and tutorial using the transforEmotion R package", + author = c( + person("Aleksandar", "Tomasevic"), + person("Hudson", "Golino"), + person("Alexander P", "Christensen") + ), + journal = "PsyArXiv", + year = 2024, + url = "https://osf.io/preprints/psyarxiv/hf3g7", + keywords = "at", + doi = "10.31234/osf.io/hf3g7", + language = "en" +) \ No newline at end of file diff --git a/man/MASS_mvrnorm.Rd b/man/MASS_mvrnorm.Rd index c7da501..a239d41 100644 --- a/man/MASS_mvrnorm.Rd +++ b/man/MASS_mvrnorm.Rd @@ -4,14 +4,7 @@ \alias{MASS_mvrnorm} \title{Multivariate Normal (Gaussian) Distribution} \usage{ -MASS_mvrnorm( - n = 1, - mu, - Sigma, - tol = 0.000001, - empirical = FALSE, - EISPACK = FALSE -) +MASS_mvrnorm(n = 1, mu, Sigma, tol = 1e-06, empirical = FALSE, EISPACK = FALSE) } \arguments{ \item{n}{Numeric integer. diff --git a/man/dlo_dynamics.Rd b/man/dlo_dynamics.Rd index ece29ab..1e3c534 100644 --- a/man/dlo_dynamics.Rd +++ b/man/dlo_dynamics.Rd @@ -35,7 +35,7 @@ The function takes in the current state of the system, the derivative of the sta and the values of the eta and zeta parameters. It returns the updated derivative of the state. } \references{ -Ollero, M. J. F., Estrada, E., Hunter, M. D., & Cáncer, P. F. (2023). +Ollero, M. J. F., Estrada, E., Hunter, M. D., & Cancer, P. F. (2023). Characterizing affect dynamics with a damped linear oscillator model: Theoretical considerations and recommendations for individual-level applications. \emph{Psychological Methods}. \doi{10.1037/met0000615} diff --git a/man/image_scores.Rd b/man/image_scores.Rd index 63a6550..7c5df2c 100644 --- a/man/image_scores.Rd +++ b/man/image_scores.Rd @@ -23,5 +23,5 @@ If there is no face in the image, the function will return NA for all classes. Function uses reticulate to call the Python functions in the image.py file. If you run this package/function for the first time it will take some time for the package to setup a functioning Python virtual enviroment in the background. This includes installing Python libraries for facial recognition and emotion detection in text, images and video. Please be patient. } \author{ -Aleksandar Tomašević +Aleksandar Tomasevic } diff --git a/man/rag.Rd b/man/rag.Rd index c873aff..864d6a9 100644 --- a/man/rag.Rd +++ b/man/rag.Rd @@ -36,7 +36,7 @@ Available models include: \describe{ -\item{"LLAMA-2"}{The largest model available (13B parameters) but also the most challenging to get up and running for Mac and Windows. Linux operating systems run smooth. The challenge comes with installing the {llama-cpp-python} module. Currently, we do not provide support for Mac and Windows users} +\item{"LLAMA-2"}{The largest model available (13B parameters) but also the most challenging to get up and running for Mac and Windows. Linux operating systems run smooth. The challenge comes with installing the \{llama-cpp-python\} module. Currently, we do not provide support for Mac and Windows users} \item{"Mistral-7B"}{Mistral's 7B parameter model that serves as a high quality but more computationally expensive (more time consuming)} @@ -108,7 +108,7 @@ Defaults to \code{TRUE}} Returns response from TinyLLAMA } \description{ -Performs retrieval-augmented generation using {llama-index} +Performs retrieval-augmented generation \{llama-index\} Currently limited to the TinyLLAMA model } diff --git a/man/setup_gpu_modules.Rd b/man/setup_gpu_modules.Rd index 918b617..992224b 100644 --- a/man/setup_gpu_modules.Rd +++ b/man/setup_gpu_modules.Rd @@ -7,7 +7,7 @@ setup_gpu_modules() } \description{ -Installs GPU modules for the {transforEmotion} conda environment +Installs GPU modules for the \{transforEmotion\} conda environment } \details{ Installs modules for miniconda using \code{\link[reticulate]{conda_install}} diff --git a/man/setup_miniconda.Rd b/man/setup_miniconda.Rd index d9b03de..1eb2d4e 100644 --- a/man/setup_miniconda.Rd +++ b/man/setup_miniconda.Rd @@ -14,5 +14,5 @@ Installs miniconda using \code{\link[reticulate]{install_miniconda}} and activat } \author{ Alexander P. Christensen - Aleksandar Tomašević + Aleksandar Tomasevic } diff --git a/man/setup_modules.Rd b/man/setup_modules.Rd index 420df73..86875dd 100644 --- a/man/setup_modules.Rd +++ b/man/setup_modules.Rd @@ -7,7 +7,7 @@ setup_modules() } \description{ -Installs modules for the {transforEmotion} conda environment +Installs modules for the \{transforEmotion\} conda environment } \details{ Installs modules for miniconda using \code{\link[reticulate]{conda_install}} diff --git a/man/video_scores.Rd b/man/video_scores.Rd index b6ea4a5..9c13aa7 100644 --- a/man/video_scores.Rd +++ b/man/video_scores.Rd @@ -51,5 +51,5 @@ A result object containing the analyzed video scores. This function retrieves FER scores a specific number of frames extracted from YouTube video. It uses Python libraries for facial recognition and emotion detection in text, images, and videos. } \author{ -Aleksandar Tomašević +Aleksandar Tomasevic }