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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nlp_cache_sebastian_stigler-0.3.0.tar.gz.
File metadata
- Download URL: nlp_cache_sebastian_stigler-0.3.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cedef96fda4c2915c813e6a8a10240be5ef762e6b56174b5e7ea00753cfd710f
|
|
| MD5 |
b0d1ed38f6afa72a9ec7c53d28dfece0
|
|
| BLAKE2b-256 |
b5ade0d1379f5e62fb7108320aea8b5617e89c5f9cc7f439b4f597ba24a4534f
|
File details
Details for the file nlp_cache_sebastian_stigler-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nlp_cache_sebastian_stigler-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73e49397eafb535ff190b2931e513129685e2f93f2aa9a54147efe10b511cf52
|
|
| MD5 |
c1a6cb669f57ab5905e52d3f930efbea
|
|
| BLAKE2b-256 |
5f41bd9aca96318a82023a9f9a4b2d07ecc0fe15a429eb669bd8a172d869e61d
|