Closed theHazzard closed 4 years ago
I am having issue with the same problem every time i deploy it to the cloud heroku. Did you find any solution? thanks!
Hi @theHazzard @christopherhm0029
The resources are packaged as python packages so you can add them to the requirements.txt
file. Here is how to proceed:
First, locate the resources you want on this page. Then copy the URL link to the corresponding tar.gz file and put it in your requirements.txt
file, for instance:
flask==1.1.1
snips-nlu==0.20.1
https://github.com/snipsco/snips-nlu-language-resources/releases/download/snips_nlu_en-0.2.3/snips_nlu_en-0.2.3.tar.gz
At this stage, the resources will be installed as a regular python package, with a name like snips_nlu_en
(or snips_nlu_<language>
in general).
What is left to do is to tell snips-nlu
where to find the resources (when you use the CLI to download the resources, an extra linking step is performed in order to allow snips-nlu
to find the resources in a default location).
Here is how to instantiate your SnipsNLUEngine
to make it point to the manually installed resources:
from snips_nlu import SnipsNLUEngine, load_resources
# replace "snips_nlu_en" by "snips_nlu_<language>" if you are not using english
engine = SnipsNLUEngine(resources=load_resources("snips_nlu_en"))
I hope this helps, please tell me if you still have troubles.
Hi @theHazzard @christopherhm0029 The resources are packaged as python packages so you can add them to the
requirements.txt
file. Here is how to proceed: First, locate the resources you want on this page. Then copy the URL link to the corresponding tar.gz file and put it in yourrequirements.txt
file, for instance:flask==1.1.1 snips-nlu==0.20.1 https://github.com/snipsco/snips-nlu-language-resources/releases/download/snips_nlu_en-0.2.3/snips_nlu_en-0.2.3.tar.gz
At this stage, the resources will be installed as a regular python package, with a name like
snips_nlu_en
(orsnips_nlu_<language>
in general). What is left to do is to tellsnips-nlu
where to find the resources (when you use the CLI to download the resources, an extra linking step is performed in order to allowsnips-nlu
to find the resources in a default location). Here is how to instantiate yourSnipsNLUEngine
to make it point to the manually installed resources:from snips_nlu import SnipsNLUEngine, load_resources # replace "snips_nlu_en" by "snips_nlu_<language>" if you are not using english engine = SnipsNLUEngine(resources=load_resources("snips_nlu_en"))
I hope this helps, please tell me if you still have troubles.
hi i had similar issue this solved for nlu language resource but i also need to use builtin entity which has similar process and i cant get to seem that working. Can you help with that @adrienball can you help with this
Hey @sarab97 The builtin entity resources are stored in a different place. Here are the URLs where they can be downloaded from:
snips/city
=> https://resources.snips.ai/nlu/gazetteer-entities/en/city/v0.2/snips_nlu_city_en-0.2.0.tar.gzsnips/country
=> https://resources.snips.ai/nlu/gazetteer-entities/en/country/v0.2/snips_nlu_country_en-0.2.0.tar.gzsnips/region
=> https://resources.snips.ai/nlu/gazetteer-entities/en/region/v0.2/snips_nlu_region_en-0.2.0.tar.gzsnips/musicAlbum
=> https://resources.snips.ai/nlu/gazetteer-entities/en/musicalbum/v0.2/snips_nlu_musicalbum_en-0.2.5.tar.gzsnips/musicArtist
=> https://resources.snips.ai/nlu/gazetteer-entities/en/musicartist/v0.2/snips_nlu_musicartist_en-0.2.3.tar.gzsnips/musicTrack
=> https://resources.snips.ai/nlu/gazetteer-entities/en/musictrack/v0.2/snips_nlu_musictrack_en-0.2.5.tar.gzBest
Hi! I'm trying to deploy snips to a google cloud functions, and I can't run the command there, is there a way to add it to the requirements.txt file?