Skip to content

Instantly share code, notes, and snippets.

@ahmedbesbes
Created August 18, 2022 23:02
Show Gist options
  • Save ahmedbesbes/ffee9fa3edcd07da17c09ff196b24898 to your computer and use it in GitHub Desktop.
Save ahmedbesbes/ffee9fa3edcd07da17c09ff196b24898 to your computer and use it in GitHub Desktop.
import os
import spacy
nlp = spacy.load("en_core_news_sm")
texts = ... # a large list of documents
docs = []
for doc in nlp.pipe(texts, n_process=os.cpu_count()-1):
docs.append(doc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment