课程: Complete Guide to NLP with R

今天就学习课程吧!

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

Examining corpora

Examining corpora

- Let's talk about corpora, the plural of corpus. There are different types of corpus available with the TM library. In most cases, you'll use simple corpus but it's useful to know of the other types in case you either run into them or you find that you need their capabilities. Let's start in line one where I bring in the text mining library, and then in line five I'm going to use the corpus command. I've created a directory source pointing to a directory called poetry and I'm only selecting the text files. Now, direct resource is a special command that we'll cover in the next session on sources. For right now what you need to know is that direct resource pulls in files from a directory. The corpus command is interesting because TM provides it as a shortcut to selecting whatever is the appropriate corpus type. In most cases, it will produce a simple corpus. In some cases it will produce other types. Let's go ahead and…

内容