mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
db55577c45
* Remove unicode declarations * Remove Python 3.5 and 2.7 from CI * Don't require pathlib * Replace compat helpers * Remove OrderedDict * Use f-strings * Set Cython compiler language level * Fix typo * Re-add OrderedDict for Table * Update setup.cfg * Revert CONTRIBUTING.md * Revert lookups.md * Revert top-level.md * Small adjustments and docs [ci skip]
31 lines
987 B
Python
31 lines
987 B
Python
if __name__ == "__main__":
|
|
import plac
|
|
import sys
|
|
from wasabi import msg
|
|
from spacy.cli import download, link, info, package, train, pretrain, convert
|
|
from spacy.cli import init_model, profile, evaluate, validate, debug_data
|
|
|
|
commands = {
|
|
"download": download,
|
|
"link": link,
|
|
"info": info,
|
|
"train": train,
|
|
"pretrain": pretrain,
|
|
"debug-data": debug_data,
|
|
"evaluate": evaluate,
|
|
"convert": convert,
|
|
"package": package,
|
|
"init-model": init_model,
|
|
"profile": profile,
|
|
"validate": validate,
|
|
}
|
|
if len(sys.argv) == 1:
|
|
msg.info("Available commands", ", ".join(commands), exits=1)
|
|
command = sys.argv.pop(1)
|
|
sys.argv[0] = "spacy %s" % command
|
|
if command in commands:
|
|
plac.call(commands[command], sys.argv[1:])
|
|
else:
|
|
available = f"Available: {', '.join(commands)}"
|
|
msg.fail(f"Unknown command: {command}", available, exits=1)
|