0

I am recently doing project in nlp using python. Where I need to preprocess a csv file which contains text with many row and column. I could became able to stem only simple sentence only. And couldn't able to stem whole csv file at once. How can I do that?

Adrian Cid Almaguer
  • 7,815
  • 13
  • 41
  • 63
kiran
  • 21
  • 2

1 Answers1

0

You'll probably have to read the entire CSV file and stem each cell. The Python csv library will allow you to read the CSV file. You'll probably want to use csv.reader() or csv.DictReader(). The first will allow you to loop through the rows of the CSV and read them individually; the second will automatically put the data from the CSV into a Python dictionary. Either would be a good option for your task.

Once you have read in the CSV, you will need to stem the words you have read in. You might use the nltk library, which you might need to install, if you have not already done that. Here is a resource about stemming with nltk.

s.py
  • 197
  • 10