首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >google新闻标题运行情绪分析在使用udpipe时遇到错误

google新闻标题运行情绪分析在使用udpipe时遇到错误
EN

Stack Overflow用户
提问于 2022-04-03 18:35:40
回答 1查看 142关注 0票数 -1

,这是到目前为止我的代码

代码语言:javascript
运行
复制
pacman::p_load(dplyr, ggplot2, stringr, udpipe, lattice)
gnewsheadlines <- read.csv(file.choose(), stringsAsFactors = F)

udmodel_english <- udpipe_load_model(file = "C:/Users/Palam/Documents/english-ewt-ud-2.5-191206.udpipe")

步骤2 -按日期计算标题总数并绘制要检查的结果

代码语言:javascript
运行
复制
headlinegoogle <- gnewsheadlines %>% filter(date >= "3/31/2022 ", date <= "4/3/2022")

s <- udpipe_annotate(udmodel_english,headlinegoogle$headline)
x <- data.frame(s)

这是我在运行udpipe_annotate时遇到的错误:

代码语言:javascript
运行
复制
Error in `[.data.table`(out, , `:=`(c("token_id", "token", "lemma", "upos",  :
Supplied 10 columns to be assigned an empty list (which may be an empty data.table or data.frame since they are lists too). To delete multiple columns use NULL instead. To add multiple empty list columns, use list(list()).

此外:警告信息:

代码语言:javascript
运行
复制
In strsplit(x$conllu, "\\n", fixed = TRUE) : input string 1 is invalid UTF-8
EN

Stack Overflow用户

发布于 2022-04-09 15:25:42

看起来头谷歌$标题不是在UTF-8编码。请参阅https://cran.r-project.org/web/packages/udpipe/vignettes/udpipe-tryitout.html

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71728836

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档