From d5d67d842aba258deb184ce357db012d26788b76 Mon Sep 17 00:00:00 2001 From: Alexander Christensen Date: Wed, 21 Aug 2024 05:17:05 -0500 Subject: [PATCH] removed problematic code in `rag` @atomashevic --- DESCRIPTION | 4 ++-- R/rag.R | 45 --------------------------------------------- 2 files changed, 2 insertions(+), 47 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0111583..4213fac 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: transforEmotion Title: Sentiment Analysis for Text, Image and Video using Transformer Models -Version: 0.1.5 -Date: 2024-08-02 +Version: 0.1.6 +Date: 2024-08-21 Authors@R: c(person("Alexander", "Christensen", email = "alexpaulchristensen@gmail.com", role = "aut", comment = c(ORCID = "0000-0002-9798-7037")), person("Hudson", "Golino", email = "hfg9s@virginia.edu", role = "aut", diff --git a/R/rag.R b/R/rag.R index f38d09c..5fdac5e 100644 --- a/R/rag.R +++ b/R/rag.R @@ -387,51 +387,6 @@ content_cleanup <- function(content) } -#' @noRd -# Get document embedding ---- -# Updated 28.01.2024 -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, - dimnames = list( - NULL, c("document", "text", "score") - ) - ) - - # Loop over content - for(i in seq_len(n_documents)){ - - # Populate matrix - content_df[i,] <- c( - content[[i]]$id_, content[[i]]$text, content[[i]]$score - ) - - } - - # Make it a real data frame - content_df <- as.data.frame(content_df) - - # Set proper modes - content_df$score <- as.numeric(content_df$score) - - # Return data frame - return(content_df) - -} - #' @noRd # LLAMA-2 ---- # Updated 06.02.2024