Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nlp-cache-sebastian-stigler

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nlp-cache-sebastian-stigler

A caching component for `Doc` classes in `spacy`.

  • 0.3.0
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc