예제 #1
0
def main():
    args = parse_args()
    OpenKSModel.list_modules()
    model: ExpertRecModel = OpenKSModel.get_module("PyTorch", "HGTExpertRec")(
        "openks/data/nsf_dblp_kg/nsfkg/", args)
    model.preprocess_data()
    model.load_data_and_model()
    logger.info('Training HGT with #param: %d' % model.get_n_params())
    model.train_expert()
    model.evaluate()
예제 #2
0
# Copyright (c) 2022 OpenKS Authors, SCIR, HIT.
# All Rights Reserved.

from openks.models import OpenKSModel
import argparse
# 列出已加载模型
OpenKSModel.list_modules()

parser = argparse.ArgumentParser(
    description=
    'Implement of SISO, SIMO, MISO, MIMO for Conditional Statement Extraction')

# Model parameters.
parser.add_argument('--train',
                    type=str,
                    default='data/stmts-train.tsv',
                    help='location of the labeled training set')
parser.add_argument('--eval',
                    type=str,
                    default='data/stmts-eval.tsv',
                    help='location of the evaluation set')
parser.add_argument('--model_name',
                    type=str,
                    default='MIMO_BERT_LSTM',
                    help='the model to be trained')
parser.add_argument('--language_model',
                    type=str,
                    default='resources/model.pt',
                    help='language model checkpoint to use')
parser.add_argument('--wordembed',
                    type=str,