In want to setup python's nltk
library including wordnet
in such a way that it can be easily copied from development system to production server, without having requirement for downloading wordnet
separately.
Any suggestion would be helpful开发者_如何学Python...
When you download wordnet through NLTK it puts wordnet in the nltk_data folder on your system. On my system it's in the home folder. ~/nltk_data/corpora/wordnet The files of wordnet should be available there. You may be able to transfer those files to your production server and point nltk at them to find them.
Another way is to transfer the information from wordnet into a database, and then query the database for the information you're looking for. This removes the entire dependence on NLTK and leaves you with all the information from wordnet.
There is a library that aides in moving the information from wordnet to an SQL database. It's available here: http://wnsqlbuilder.sourceforge.net/
Here is the schema they used: http://wnsqlbuilder.sourceforge.net/schema.html Here are some example queries: http://wnsqlbuilder.sourceforge.net/sql-dict.html
That should be able to get you started.
精彩评论