def setUp(self): self.test_data_file = create_test_data(__file__) self.config[ "embedding_name"] = "w2v.sikuquanshu.target.word-word.dim300" self.config["trainable"] = True
test_cnt = int(args[1]) test_loop_cnt = int(args[2]) data_cnt = int(args[3]) data_min_length = int(args[4]) data_max_length = int(args[5]) if len(args) > 6 and args[6] == "False": is_jp = False else: is_jp = True for i in range(test_cnt): print("----- test %d -----" % (i + 1)) # create test data data_dict = util.create_test_data(data_cnt, data_min_length, data_max_length, is_jp) for j in range(test_loop_cnt): r = redis.Redis(host='localhost', port=6379, db=0) print("") print("test %d - %d" % (i + 1, j + 1)) # hash util.reset_redis(r) memory_base = util.get_redis_memory() util.set_redis_hash(r, data_dict) memory_hash = util.get_redis_memory() used_memory_hash = memory_hash - memory_base
def create_test(ctx): session = ctx.obj["SESSION_FACTORY"]() create_test_data(session)
def setUp(self): test_data_file = create_test_data(__file__) self.vocab = Vocab.load_vocabulary(test_data_file, unk_token='[UNK]') self.tokenizer = JiebaTokenizer(self.vocab)