CoreNLP in CleanNLP - Runtime error "Expected dtype int64 for index"

Viewed 1963

I am encountering the error Error in py_call_impl(callable, dots$args, dots$keywords) : RuntimeError: index_select(): Expected dtype int64 for index when I try to run corenlp on longer strings of text (this is what I think triggered the issue) via CleanNLP in R.

library(reticulate)
Sys.setenv(RETICULATE_PYTHON = 'C:/Users/myname/AppData/Local/r-miniconda/envs/r-reticulate')
py_discover_config(required_module="cleannlp")
# Initialise model
cnlp_init_corenlp()

Running it on this sample text tibble works:

justtext <- tibble(
  id = 1:3,
  text = c("Let me be the one you call. 
           If you jump, I'll break your fall.", 
           "Let me be the one you call. 
           If you jump, I'll break your fall.",
           "Let me be the one you call. If you jump, I'll break your fall.")
)
cnlp_annotate(justtext)

However, I encounter the issue when I lengthen a string of text, like so:

justtext <- tibble(
  id = 1:3,
  text = c("Let me be the one you call. 
           If you jump, I'll break your fall.", 
           "Let me be the one you call. 
           If you jump, I'll break your fall.",
           "Let me be the one you call. If you jump, I'll break your fall the quick brown fox jumped over the lazy dog.")
)
cnlp_annotate(justtext)
Error in py_call_impl(callable, dots$args, dots$keywords) : RuntimeError: index_select(): Expected dtype int64 for index

How can I get around this? The texts I want to process are each of a much longer length than one short sentence.

1 Answers
Related