课程: Complete Guide to NLP with R

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Combining and subsetting corpora

Combining and subsetting corpora - R教程

课程: Complete Guide to NLP with R

Combining and subsetting corpora

- As you're working with Corpora, you're sometimes going to need to filter them or combine them together. And TM provides ways for you to do this. In order to present this, I'll need a couple of Corpora, and in line four, I create simpleCorp, and in line five, I create newVCorpus. And you'll notice that one is a VCorpus, and one is a simpleCorpus. Let's move on and look at how to combine two Corpora into one. To do this, you use the C command, the standard combined command that you've used so many times in Basar. And you'll see that set up in line 13. Let's go ahead and run that, and what you'll notice is, in the upper right hand corner, I now have combinedCorpora, which is a large VCorpus, it's 97 elements, which is 26 plus 71. That all makes sense. I would like to point out something, in line 14, I've swapped simpleCorpus and newVCorpus. And now, watch what happens when I run that. You'll note that combinedCorpora…

内容