Use this tag for questions about functions from the text-package in R. The text-package transforms text to word embeddings using transformer-based language models. It also provides functions to further analyse the word embeddings such as computing semantic similarity scores or develop predictive models.
Questions tagged [r-text]
13 questions
2
votes
1 answer
I am getting a Torch error when using the textEmbed() function in the Text Package in R
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…

BoredGeek
- 21
- 2
1
vote
1 answer
Porblems when applying textEmbed function with RoBERTa on some texts
I have been using the package text since a couple of days. Everything works fine as far as you call BERT or Electra for example. However when I try to call "roberta-base" or "xlm-roberta-base" to work on some texts I get very often an error.
Example…

Luigi Curini
- 21
- 1
1
vote
1 answer
Installing r-text in R gives error Failed to build tokenizers on MAC M1 and M2 chip
When running:
textrpp_install()
this error is thrown:
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

Oscar Kjell
- 1,599
- 10
- 32
1
vote
1 answer
Why are there strange characters in the embedding value?
I am doing a simple text embedding task with the textEmbed function in r-text.
rm(list=ls())
Sys.setenv(LANG = "C.UTF-8", LC_ALL="C.UTF-8")
library(text)
temp <- textEmbed("I'm trying to do so good and I keep messing up my life. I hate it so…

AlexGu
- 41
- 4
1
vote
1 answer
Problem with building the singularity container of the "r-text" environment
I am using Ubuntu and the singularity command to build the "r-text" environment. But the terminal returned an error message.
+ apt-get install -y --no-install-recommends r-base=4.1.3* r-base-core=4.1.3* r-base-dev=4.1.3* r-recommended=4.1.3*…

AlexGu
- 41
- 4
1
vote
1 answer
textEmbed error about sentencepiece for Deberta
I get error when running deberta in the R-package text, when running:
textEmbed(“hello”, model = “microsoft/deberta-v3-base”)
error:
Error in py_call_impl(callable, dots$args, dots$keywords) :
ValueError: This tokenizer cannot be instantiated.…

John
- 309
- 3
- 12
1
vote
1 answer
"`select()` doesn't handle lists" when computing textSimilarity between two word embeddings in R
How many words in word embedding variables do you need to compute semantic similarity in r-package text? I’m trying to run:
library(text)
WEhello<-textEmbed("hello")
WEgoodbye<-textEmbed("goodbye")
textSimilarity(WEhello, WEgoodbye)
But I get this…

August Nilsson
- 55
- 3
1
vote
1 answer
Predict numeric variable from a text variable using word embeddings in R
I have a text variable with reviews of movies and another variables with ratings – I want to try to use the text reviews to predict the ratings.
Here are some example data:
movie_reviews <- c("I really loved the movie plot", "This movie really…

John
- 309
- 3
- 12
1
vote
1 answer
NLP textEmbed function
I am trying to run the textEmbed function in R.
Set up needed:
require(quanteda)
require(quanteda.textstats)
require(udpipe)
require(reticulate)
#udpipe_download_model(language = "english")
ud_eng <-…

vinita vader
- 11
- 1
0
votes
0 answers
How to use gpu when computing word embeddings in textEmbed()?
I noticed that the textEmbed function has a device option to choose between cpu or gpu.
But when running textEmbed with "device" set to "gpu" I get the message: "Unable to use CUDA (GPU), using CPU". Is there an easy way to make R use gpu instead of…

allikka
- 1
0
votes
2 answers
Errors when predicting using models created in the R-package text
I'm trying to predict from models created using the R-package text. But I am getting these two error when trying different models in different environments. I don't know if it might be related to the hardhat package?
Error in…

John
- 309
- 3
- 12
0
votes
1 answer
How to use fairseq's Megatron in r-text?
I am using R 4.1.2, reticulate 1.22 and text 0.9.50.
# install.packages("devtools")
devtools::install_github("oscarkjell/text")
library(text)
temp <- textEmbed("Hello!", model="anton-l/megatron-11b")
# Here comes an error message with traceback…

AlexGu
- 41
- 4
0
votes
1 answer
Building a singularity container for the text-package in R does not find python libraries
I want to build a singularity container for the text-package in R (which is using reticulate to access python). The singularity container builds, and the text-package is installed, and can run textEmbed("hello") as part of the installation…

Oscar Kjell
- 1,599
- 10
- 32