2015-11-15 17:58:21 +03:00
|
|
|
import plac
|
2016-10-23 20:46:28 +03:00
|
|
|
import sputnik
|
|
|
|
|
2016-03-24 13:19:43 +03:00
|
|
|
from ..download import download
|
2016-10-23 20:46:28 +03:00
|
|
|
from .. import about
|
2015-01-30 10:04:01 +03:00
|
|
|
|
2015-01-17 08:21:17 +03:00
|
|
|
|
2015-10-18 13:35:04 +03:00
|
|
|
@plac.annotations(
|
|
|
|
force=("Force overwrite", "flag", "f", bool),
|
2016-11-20 18:48:04 +03:00
|
|
|
data_path=("Path to download model", "option", "d", str)
|
2015-10-18 13:35:04 +03:00
|
|
|
)
|
2016-11-20 18:48:04 +03:00
|
|
|
def main(data_size='all', force=False, data_path=None):
|
2016-10-23 20:46:28 +03:00
|
|
|
if force:
|
|
|
|
sputnik.purge(about.__title__, about.__version__)
|
|
|
|
|
2016-10-19 01:52:16 +03:00
|
|
|
if data_size in ('all', 'parser'):
|
|
|
|
print("Downloading parsing model")
|
2016-11-20 18:48:04 +03:00
|
|
|
download('en', force=False, data_path=data_path)
|
2016-10-19 01:52:16 +03:00
|
|
|
if data_size in ('all', 'glove'):
|
|
|
|
print("Downloading GloVe vectors")
|
2016-11-20 18:48:04 +03:00
|
|
|
download('en_glove_cc_300_1m_vectors', force=False, data_path=data_path)
|
2016-01-15 20:01:02 +03:00
|
|
|
|
2015-01-02 13:44:41 +03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2015-01-31 05:51:56 +03:00
|
|
|
plac.call(main)
|