title: Stemming in python
body: <p>I want to stem my text, which I am reading from CSV file. But after the stem-operator the text is not changed. Than I have read somewhere that I need to use POS tags in order to stem but it didn't help.</p>
  
  <p>Can you please tell me what I am doing wrong? So I am reading the csv, removing punctuation, tokenizing, getting POS tags, and trying to stem but nothing is changing. </p>
  
  <pre><code>from nltk.tokenize import sent_tokenize, word_tokenize
  from nltk.stem import PorterStemmer
  import nltk
  from nltk import pos_tag
  
  stemmer = nltk.PorterStemmer()
  data = pd.read_csv(open('data.csv'),sep=';')
  
  translator=str.maketrans('','',string.punctuation)
  
  with open('output.csv', 'w', newline='') as csvfile:
     writer = csv.writer(csvfile, delimiter=';',
                              quotechar='^', quoting=csv.QUOTE_MINIMAL)
  
     for line in data['sent']:
          line = line.translate(translator)
          tokens = word_tokenize(line)
          tokens_pos = nltk.pos_tag(tokens)
          final = [stemmer.stem(tagged_word[0]) for tagged_word in tokens_pos]
          writer.writerow(tokens_pos)
  </code></pre>
  
  <p>Examples of data for stemming:</p>
  
  <pre><code>The question was, what are you going to cut?
  Well, again, while you were on the board of the Woods Foundation...
  We've got some long-term challenges in this economy.
  </code></pre>
  
  <p>Thank you in advance for any help!</p>