1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

add list and augment functionality + tests

This commit is contained in:
Jack Morris
2020-06-20 15:04:45 -04:00
parent 8dcc0805b3
commit 7bdc6e457b
21 changed files with 593 additions and 277 deletions

View File

@@ -1,18 +1,22 @@
#!/usr/bin/env python
import argparse
import os
import sys
from textattack.commands.attack import AttackCommand
from textattack.commands.attack import AttackResumeCommand
from textattack.commands.attack import AttackCommand, AttackResumeCommand
from textattack.commands.augment import AugmentCommand
from textattack.commands.benchmark_model import BenchmarkModelCommand
from textattack.commands.benchmark_recipe import BenchmarkRecipeCommand
from textattack.commands.list_things import ListThingsCommand
from textattack.commands.train_model import TrainModelCommand
def main():
print('main()')
parser = argparse.ArgumentParser("TextAttack CLI", usage="[python -m] texattack <command> [<args>]",
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser = argparse.ArgumentParser(
"TextAttack CLI",
usage="[python -m] texattack <command> [<args>]",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
subparsers = parser.add_subparsers(help="textattack command helpers")
# Register commands
@@ -21,11 +25,12 @@ def main():
AugmentCommand.register_subcommand(subparsers)
BenchmarkModelCommand.register_subcommand(subparsers)
BenchmarkRecipeCommand.register_subcommand(subparsers)
ListThingsCommand.register_subcommand(subparsers)
TrainModelCommand.register_subcommand(subparsers)
# Let's go
args = parser.parse_args()
if not hasattr(args, "func"):
parser.print_help()
exit(1)