课程: Complete Guide to NLP with R
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Create the document-term matrix
- In the previous session, I showed you the simple concept of setting up a document term matrices, or a term document matrices, or a document feature matrices. There are options you'll want to be aware of that will save you time and processing power when you're working with larger documents. Let's spend some time looking at how you can tweak the creation of a document term matrix. In the code I'm showing you in line two, I bring in the TM package and then in line five I read the poet corpus dot rds and this is a sample file. Your current working directory should of course point towards a directory that contains poet corpus dot rds. In lines 10 through 22, I've set up a standard document term matrix creation command and I'll run that, and in a second it will produce the DT matrix. Let's take a quick look at that matrix. In line 24, I'm using the inspect command, and it gives me information about the matrix, plus it also…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。