Skip to content

Commit

Permalink
removed problematic code in rag
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexChristensen committed Aug 21, 2024
1 parent 9d14dfd commit d5d67d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 47 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]",
role = "aut", comment = c(ORCID = "0000-0002-9798-7037")),
person("Hudson", "Golino", email = "[email protected]", role = "aut",
Expand Down
45 changes: 0 additions & 45 deletions R/rag.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d5d67d8

Please sign in to comment.