Skip to content

Commit

Permalink
Fix minor issues for CRAN submission; citation updated
Browse files Browse the repository at this point in the history
  • Loading branch information
atomashevic committed Aug 20, 2024
1 parent c32cd65 commit 41bb99f
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 40 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]", role = "aut",
comment = c(ORCID = "0000-0002-1601-1447")),
person("Aleksandar", "Tomašević", email = "[email protected]", role = c("aut", "cre"),
person("Aleksandar", "Tomasevic", email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4863-6051")))
Maintainer: Aleksandar Tomašević <[email protected]>
Maintainer: Aleksandar Tomasevic <[email protected]>
Description: Implements sentiment analysis using huggingface <https://huggingface.co> transformer zero-shot classification model pipelines for text and image data. The default text pipeline is Cross-Encoder's DistilRoBERTa <https://huggingface.co/cross-encoder/nli-distilroberta-base> and default image/video pipeline is Open AI's CLIP <https://huggingface.co/openai/clip-vit-base-patch32>. All other zero-shot classification model pipelines can be implemented using their model name from <https://huggingface.co/models?pipeline_tag=zero-shot-classification>.
License: GPL (>= 3.0)
Encoding: UTF-8
Expand Down
2 changes: 1 addition & 1 deletion R/dlo.R
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion R/image_scores.R
Original file line number Diff line number Diff line change
Expand Up @@ -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ć <[email protected]>
#' @author Aleksandar Tomasevic <[email protected]>
#' @importFrom reticulate source_python
#' @importFrom reticulate py
#' @export
Expand Down
11 changes: 9 additions & 2 deletions R/rag.R
Original file line number Diff line number Diff line change
@@ -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
#'
Expand All @@ -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)}
#'
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion R/setup_gpu_modules.R
Original file line number Diff line number Diff line change
@@ -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}}
#'
Expand Down
2 changes: 1 addition & 1 deletion R/setup_miniconda.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
#' Aleksandar Tomašević <[email protected]>
#' Aleksandar Tomasevic <[email protected]>
#'
#' @export
#'
Expand Down
2 changes: 1 addition & 1 deletion R/setup_modules.R
Original file line number Diff line number Diff line change
@@ -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}}
#'
Expand Down
2 changes: 1 addition & 1 deletion R/video_scores.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#'
#' @return A result object containing the analyzed video scores.
#'
#' @author Aleksandar Tomašević <[email protected]>
#' @author Aleksandar Tomasevic <[email protected]>
#' @import reticulate
#'
#' @export
Expand Down
29 changes: 15 additions & 14 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -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"
)
9 changes: 1 addition & 8 deletions man/MASS_mvrnorm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dlo_dynamics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/image_scores.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/rag.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/setup_gpu_modules.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/setup_miniconda.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/setup_modules.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/video_scores.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 41bb99f

Please sign in to comment.