在使用spacy的时候,感觉比nltk慢了许多,一直在寻找并行化的方案,好在找到了,下面给出spaCy并行化的分词方法使用示例:

import spacy

nlp = spacy.load("en")

docs = [
    "Our dream was to bring to Shanghai a tribute event dedicated to China which tells our history and visio.",
    "It was not simply a fashion show, but something that we created especially with love and passion for China and all the people around the world who loves Dolce & Gabbana"
]

for doc in nlp.pipe(docs, batch_size=100, n_threads=3):
    print(list(doc))
    print("*" * 50)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2021-05-19
猜你喜欢
  • 2022-12-23
  • 2021-09-14
  • 2022-02-27
  • 2022-01-08
  • 2021-07-27
  • 2021-09-18
  • 2021-08-31
相关资源
相似解决方案