How to build a Term-Document-Matrix from a set of texts and a specific set of terms (tags)?

前端 未结 2 1117
清歌不尽
清歌不尽 2021-02-06 14:18

I have two sets of data:

  • a set of tags (single words like php, html, etc)

  • a set of texts

I wish now

相关标签:
2条回答
  • 2021-02-06 14:41
    DocumentTermMatrix(docs, list(dictionary = Dictionary$Var1)) 
    

    You could pre-defined the dictionary using the set tags

    0 讨论(0)
  • 2021-02-06 14:48
    tdm.onlytags <- tdm[rownames(tdm)%in%TagSet$tag,]
    

    to select only your specified words and next proceed with your analysis.

    0 讨论(0)
提交回复
热议问题