Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用R中的三叉图进行LDA?_R_Nlp_Lda - Fatal编程技术网

如何使用R中的三叉图进行LDA?

如何使用R中的三叉图进行LDA?,r,nlp,lda,R,Nlp,Lda,我试图利用LDA与三叉图,而不是单一的单词。我基本上是把一个三角形当作一个单词。我必须遵循下面的代码 MD_notes_phrases <- MD_notes %>% group_by(status) %>% unnest_tokens(trigram, text, token = "ngrams", n = 3) %>% separate(trigram, c("word1", "word2", "word3"), sep = " ") %>% filter(!w

我试图利用LDA与三叉图,而不是单一的单词。我基本上是把一个三角形当作一个单词。我必须遵循下面的代码

MD_notes_phrases <- MD_notes %>%
group_by(status) %>%
unnest_tokens(trigram, text, token = "ngrams", n = 3) %>%
separate(trigram, c("word1", "word2", "word3"), sep = " ") %>%
filter(!word1 %in% stop_words$word,
       !word1 %in% removedWords$word,
       !word2 %in% stop_words$word,
       !word2 %in% removedWords$word,
       !word3 %in% stop_words$word,
       !word3 %in% removedWords$word) %>%
mutate(phrase = paste(word1,word2,word3,sep = " "))
DTM <- MD_notes_phrases %>%
  cast_dtm(document = status,term = phrase,n)

感谢您的帮助。如果这是一个方法问题而不是代码问题,我提前表示歉意。

您能分享一个可复制的示例,包括一些原始数据吗?您能分享一个可复制的示例,包括一些原始数据吗?
Error in .M.kind(x) : not yet implemented for matrix with typeof NULL