A caching component for `Doc` classes in `spacy`.
Project description
NLP Cache
A caching component for Doc
classes in spacy
Installation
pip install nlp_cache_sebastian_stigler
Usage
import spacy
nlp = spacy.load("de_core_news_sm")
text = "Ich wünsche Ihnen einen guten Morgen!"
doc_1 = nlp(text) # mean loading time about 4.5 ms
doc_2 = nlp(text) # recurrent mean loading time about 4.5 ms
To speed up loading a recurrent text you can use this caching utility, to
lookup known texts from the cache stored in the cache
directory .
import spacy
from nlp_cache import NlpCache
nlp = NlpCache(uncached_nlp=spacy.load("de_core_news_sm"), path="cache")
text = "Ich wünsche Ihnen einen guten Morgen!"
doc_1 = nlp(text) # mean loading time about 4.5 ms
doc_2 = nlp(text) # recurrent mean loading time about 840 µs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for nlp_cache_sebastian_stigler-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 882e5a30f6844539ddc5428087635b76dc3f3a3ccb37b4170e6c6e871b6b6f91 |
|
MD5 | addfdf868d2b981427e01606fc2114ff |
|
BLAKE2b-256 | 24f1ba7a67398fc4aa650444840c7ba5765ec6d8cc56651a036caa754eda69c1 |
Close
Hashes for nlp_cache_sebastian_stigler-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa5ca7cf39b2ad6c740593a550893aae9b21f89caa6a12803d3a5add7b753a98 |
|
MD5 | a84b9aea3b299380a335b768c04f59e2 |
|
BLAKE2b-256 | 43dab359d3a3a7170e0be26d155cfaac648c6cca68d3022a2a4f4c8acb2074cf |