Skip to content

Feat/4.2 faster spacy #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 27, 2025
Merged

Feat/4.2 faster spacy #57

merged 6 commits into from
Apr 27, 2025

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