问题描述
当我尝试通过 R 中的 CleanNLP 在较长的文本字符串上运行 corenlp 时遇到错误 Error in py_call_impl(callable,dots$args,dots$keywords) : RuntimeError: index_select(): Expected dtype int64 for index
。
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()
在此示例文本 tibble 上运行它:
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,"Let me be the one you call. If you jump,I'll break your fall.")
)
cnlp_annotate(justtext)
但是,当我延长一串文本时,我遇到了这个问题,如下所示:
justtext <- tibble(
id = 1:3,I'll break your fall the quick brown fox jumped over the lazy dog.")
)
cnlp_annotate(justtext)
Error in py_call_impl(callable,dots$keywords) : RuntimeError: index_select(): Expected dtype int64 for index
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)