为KWIC DF节省docvars吗?

发布于 2025-01-21 22:24:41 字数 292 浏览 1 评论 0原文

有没有办法将docvars保存到KWIC输出数据框架?我想保存docvars,例如日期和文档标题。我已经阅读了 https://github.com/quanteda/quanteda/quanteda/quanteda/649 ,但不明白最后是否发生了变化。

我想稍后使用围绕关键字的单词使用组变量运行其他文本分析,例如STM和TF_IDF。

Is there a way to save docvars to kwic output dataframe? I would like to save docvars such as dates and title of documents. I've read this https://github.com/quanteda/quanteda/issues/649 but can't understand if there was a change in the end.

I would like to later use the words surrounding my keyword to run other text analyses such as stm and tf_idf using group variables.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森林散布 2025-01-28 22:24:41

我已经手动完成了此操作,请参见下面的示例:

docvars_df <- docvars(toks.full)
docvars_df$docname <- paste("text", 1:nrow(docvars_df), sep = "")

# attaching docvars:
kwic_df <- merge(kwic_df, docvars_df, by = "docname")

I have done this manually, see example below:

docvars_df <- docvars(toks.full)
docvars_df$docname <- paste("text", 1:nrow(docvars_df), sep = "")

# attaching docvars:
kwic_df <- merge(kwic_df, docvars_df, by = "docname")

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文