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 (relative
to the current 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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cedef96fda4c2915c813e6a8a10240be5ef762e6b56174b5e7ea00753cfd710f |
|
MD5 | b0d1ed38f6afa72a9ec7c53d28dfece0 |
|
BLAKE2b-256 | b5ade0d1379f5e62fb7108320aea8b5617e89c5f9cc7f439b4f597ba24a4534f |
Close
Hashes for nlp_cache_sebastian_stigler-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73e49397eafb535ff190b2931e513129685e2f93f2aa9a54147efe10b511cf52 |
|
MD5 | c1a6cb669f57ab5905e52d3f930efbea |
|
BLAKE2b-256 | 5f41bd9aca96318a82023a9f9a4b2d07ecc0fe15a429eb669bd8a172d869e61d |