Skip to content

Feat/4.2 faster spacy#57

Merged
sidmohan0 merged 6 commits intodevfrom
feat/4.2-faster-spacy
Apr 27, 2025
Merged

Feat/4.2 faster spacy#57
sidmohan0 merged 6 commits intodevfrom
feat/4.2-faster-spacy

Conversation

@sidmohan0
Copy link
Contributor

Implemented batch processing in SpacyAnnotator using nlp.pipe() for better performance.
Added model caching for spaCy models.
Made spaCy and Tesseract calls asynchronous using asyncio.to_thread.
Made the spaCy batch size configurable via the DATAFOG_SPACY_BATCH_SIZE environment variable.
Added comprehensive tests for the new functionality.
Updated the README.md to document the new features and configuration.
Ensured all code passed tox and pre-commit checks.

Completes Task 2 (TICKETS 4.2.4-4.2.7)
- Refactors SpacyAnnotator.annotate_text to use nlp.pipe for batching.
- Adds DATAFOG_SPACY_BATCH_SIZE env var for configurable batch size.
- Includes module-level caching for spaCy models.
- Wraps blocking spaCy/Tesseract calls in asyncio.to_thread.
- Adds tests for batch size configuration.
- Updates README with new features and configuration.
@sidmohan0 sidmohan0 merged commit c70bce0 into dev Apr 27, 2025
5 checks passed
@sidmohan0 sidmohan0 deleted the feat/4.2-faster-spacy branch April 28, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant