title: How can I lemmatize list of lists in python using spacy?
body: <p>I have a list of lists that contain words that need to be lemmatized. I am getting an error that says string is required instead of list because I am using Spacy. </p>
  
  <p>If I convert to string i.e. <code>nlp(str(list_1))</code>, then the list separators(like: "," and "[") are tokenized and included in my output. </p>
  
  <p>How can I lemmatize the items in my list of lists and get it back to the same form i.e. list of lists?</p>
  
  <p>The words that need to be lemmatized could be anywhere in the list of lists.</p>
  
  <p>I would like something like this:</p>
  
  <p>Input: </p>
  
  <p><code>[["flower", "grows", "garden"], [["boy", "running", "playground"]]</code></p>
  
  <p>Output:</p>
  
  <p><code>[["flower", "grow", "garden"], ["boy", "run", "playground"]]</code></p>
  
  <pre><code>import spacy
  nlp = spacy.load("en_core_web_sm")
  list_1 = [["flower", "grows", "garden"], ["boy", "running", "playground"]]
  
  for item in nlp(str(list_1)):
        print(item.lemma_)
  </code></pre>