loading files to categorized plain text corpus

571 Views Asked by At

I am using ubuntu and as part of my assignment,im doing text sentiment analysis. I am making a training set to classify text using NaiveBayes classifier, i have many files containing sentences and saved as sent1.txt,sent2.txt. . . and a file called label.txt

label.txt contains sent1.txt:pos sent2.txt:pos ... sent 15:txt:neg sent16.txt:neg

all the sent files and lable.txt files are stored in \home\abha.I tried this

from nltk.corpus.reader import CategorizedPlaintextCorpusReader
reader = CategorizedPlaintextCorpusReader('.', r'.*\.txt', cat_file='cats/cats.txt')

Please tell me What should my third argument be?

Im having such silly issues with where to store the label.txt file and the sent files.

0

There are 0 best solutions below