# How to do pre-processing with spaCy or NLTK if they require external download?

**URL:** <https://community.drivendata.org/t/how-to-do-pre-processing-with-spacy-or-nltk-if-they-require-external-download/10959>\
**Category:** Youth Mental Health: Automated Abstraction\
**Created:** [November 11, 2024, 3:59pm UTC](https://community.drivendata.org/t/how-to-do-pre-processing-with-spacy-or-nltk-if-they-require-external-download/10959 "2024-11-11T15:59:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomaz-suller](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tomaz-suller](https://community.drivendata.org/u/tomaz-suller)\
**Post date:** [November 11, 2024, 3:59pm UTC](https://community.drivendata.org/t/how-to-do-pre-processing-with-spacy-or-nltk-if-they-require-external-download/10959/1 "2024-11-11T15:59:55Z")

</div>

Hi there everyone. My team is using spaCy for pre-processing the narratives before modelling, and we don’t really know how to make it work given we can’t download the pre-trained models on the fly in the competition environment. I’ve made a [PR](https://github.com/drivendataorg/youth-mental-health-runtime/pull/29) to the runtime repo to add the model we use, but I’m not sure it’ll be analysed on time.

Is there a way around that? Has anyone done pre-processing using these libraries but without needing any external dependencies?

Thanks!

I honestly should’ve asked this earlier, but we focused on developing the solution a bit too much (":

---

<div class="post-metadata">

**Author:** ![tomaz-suller](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tomaz-suller](https://community.drivendata.org/u/tomaz-suller)\
**Post date:** [November 11, 2024, 4:18pm UTC](https://community.drivendata.org/t/how-to-do-pre-processing-with-spacy-or-nltk-if-they-require-external-download/10959/2 "2024-11-11T16:18:54Z")

</div>

I think I might have found a solution to my own problem haha. Will try this out later, but if anyone’s confirmed a way around it I’d love to heard about it still!

> <https://stackoverflow.com/questions/49274650/directly-load-spacy-model-from-packaged-tar-gz-file/49280552#49280552>
