title: Removing stopwords and tokenization in python
body: <p>I have following input data and I would like to remove stopwords from this input and want to do tokenization:</p>
  
  <pre><code>input = [['Hi i am going to college', 'We will meet next time possible'],
           ['My college name is jntu', 'I am into machine learning specialization'],
           ['Machine learnin is my favorite subject' ,'Here i am using python for 
                implementation']]
  </code></pre>
  
  <p>I have tried following code but not getting desired results:</p>
  
  <pre><code>from nltk.corpus import stopwords 
  from nltk.tokenize import word_tokenize 
  import nltk
  nltk.download('stopwords')
  
  stop_words = set(stopwords.words('english')) 
  
  word_tokens = word_tokenize(input) 
  
  filtered_sentence = [w for w in word_tokens if not w in stop_words] 
  
  filtered_sentence = [] 
  
  for w in word_tokens: 
      if w not in stop_words: 
          filtered_sentence.append(w) 
  
  #print(word_tokens) 
  print(filtered_sentence) 
  </code></pre>
  
  <p>Expecting output like below:</p>
  
  <pre><code>Output = [['Hi', 'going', 'college', 'meet','next', 'time', 'possible'],
            ['college', 'name','jntu', 'machine', 'learning', 'specialization'],
            ['Machine', 'learnin', 'favorite', 'subject' ,'using', 'python', 'implementation']]
  </code></pre>