I am trying to run the textEmbed() function in R using the text package in text analysis. However, I keep on getting errors telling me I haven't installed torch package, which I already have installed.
The code that I am running is as follows:
library(text)
library(torch)
# transform text data into word embeddings
wordembeddings <- textEmbed(Language_based_assessment_data_8)
wordembeddings
The error message is as follows:
Error in py_run_file_impl(file, local, convert) : ModuleNotFoundError: No module named 'torch'
The traceback error message:-
5.
stop(structure(list(message = "ModuleNotFoundError: No module named 'torch'", call = py_run_file_impl(file, local, convert), cppstack = NULL), class = c("Rcpp::exception", "C++Error", "error", "condition")))
4.
py_run_file_impl(file, local, convert)
3.
py_run_file(file, local = FALSE, convert = convert)
2.
reticulate::source_python(system.file("python", "huggingface_Interface3.py", package = "text", mustWork = TRUE))
1.
textEmbed(Language_based_assessment_data_8)
Please help!