in elq/common/params.py [0:0]
def add_model_args(self, args=None):
"""
Add model args.
"""
parser = self.add_argument_group("Model Arguments")
parser.add_argument(
"--max_seq_length",
default=256,
type=int,
help="The maximum total input sequence length after WordPiece tokenization. \n"
"Sequences longer than this will be truncated, and sequences shorter \n"
"than this will be padded.",
)
parser.add_argument(
"--max_context_length",
default=128,
type=int,
help="The maximum total context input sequence length after WordPiece tokenization. \n"
"Sequences longer than this will be truncated, and sequences shorter \n"
"than this will be padded.",
)
parser.add_argument(
"--max_cand_length",
default=128,
type=int,
help="The maximum total label input sequence length after WordPiece tokenization. \n"
"Sequences longer than this will be truncated, and sequences shorter \n"
"than this will be padded.",
)
parser.add_argument(
"--path_to_model",
default=None,
type=str,
required=False,
help="The full path to the model to load.",
)
parser.add_argument(
"--bert_model",
default="bert-base-uncased",
type=str,
help="Bert pre-trained model selected in the list: bert-base-uncased, "
"bert-large-uncased, bert-base-cased, bert-base-multilingual, bert-base-chinese.",
)
parser.add_argument(
"--pull_from_layer", type=int, default=-1, help="Layers to pull from BERT",
)
parser.add_argument(
"--lowercase",
action="store_false",
help="Whether to lower case the input text. True for uncased models, False for cased models.",
)
parser.add_argument("--context_key", default="context", type=str)
parser.add_argument("--title_key", default="entity", type=str)
parser.add_argument(
"--out_dim", type=int, default=1, help="Output dimention of bi-encoders.",
)
parser.add_argument(
"--add_linear",
action="store_true",
help="Whether to add an additonal linear projection on top of BERT.",
)
parser.add_argument(
"--data_path",
default="data/zeshel",
type=str,
help="The path to the train data.",
)
parser.add_argument(
"--output_path",
default=None,
type=str,
required=True,
help="The output directory where generated output file (model, etc.) is to be dumped.",
)
parser.add_argument(
"--mention_aggregation_type",
default=None,
type=str,
help="Type of mention aggregation (None to just use [CLS] token, "
"'all_avg' to average across tokens in mention, 'fl_avg' to average across first/last tokens in mention, "
"'{all/fl}_linear' for linear layer over mention, '{all/fl}_mlp' to MLP over mention)",
)
parser.add_argument(
"--no_mention_bounds",
dest="no_mention_bounds",
action="store_true",
default=False,
help="Don't add tokens around target mention. MUST BE FALSE IF 'mention_aggregation_type' is NONE",
)
parser.add_argument(
"--mention_scoring_method",
dest="mention_scoring_method",
default="qa_linear",
type=str,
help="Method for generating/scoring mentions boundaries (options: 'qa_mlp', 'qa_linear', 'BIO')",
)
parser.add_argument(
"--max_mention_length",
dest="max_mention_length",
default=10,
type=int,
help="Maximum length of span to consider as candidate mention",
)