import sys
import time
import pickle
import logging
from sklearn import metrics
import mindspore
import mindspore.nn as nn
from mindspore import Tensor
logging.basicConfig(
format='\033[92m%(asctime)s\033[0m \033[94m%(levelname)s\033[0m %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
level=logging.INFO,
stream=sys.stdout,
# force=True,
)
from util.dump_data import get_train_dev_test
train_x,train_y,dev_x,dev_y,test_x,vocab_size = get_train_dev_test()
train_x,train_y,dev_x,dev_y,test_x = Tensor(train_x, mindspore.int32),Tensor(train_y, mindspore.int32),Tensor(dev_x, mindspore.int32),Tensor(dev_y, mindspore.int32),Tensor(test_x, mindspore.int32)
from util.easy_args import EasyArgs
# EAsyArgs 见 blog.csdn.net/int_main_Roland/article/details/124506877
args = EasyArgs()
args.vocab_size = vocab_size
args.sample_size = 180000
args.num_class = 10
args.pad_size = 30 # util.dump_data -> pad_cut -> sz_lm
args.embed_size = 1000
arg
mindspore NLP
最新推荐文章于 2024-08-22 23:59:32 发布