2022戏剧考研名词解释检场
、佐证、短场。
import mxnet as mx。
import numpy as np。
import random。
import jieba。
#生成字符串。
def generate_text(length):。
2023戏剧考研名词解释检场text=''。
for i in range(length):。
text+=random.choice('abcdefghigklmnopqrstuvwxyz\'')。
return text。
lstm_model=mx.mod.BucketingModule(lstm_inference_symbol,。
default_bucket_key=[mx.nd.array(generate_text(30)).reshape((-1,30))],。
context=mx.cpu(),。
sym_gen=lstm_inference_symbol)。
lstm_model.bind(data_shapes=[('data',(1,30))],。
label_shapes=lstm_model._label_shapes,。
inputs_need_grad=False,。
for_training=False,。
grad_req='null')。
arg_params,aux_params=load_params('lstm_2023_text')。
lstm_model.set_params(arg_params,aux_params)。
def lstm_predict(seed,num_predict,temperature=1.0):。
print('生成的文章:')。
print(seed)。
#将输入的单词编码成数字。
seed_seq=[word_indict.get(w,0) for w in seed.rstrip().split(' ')]。
seed_seq=np.array(seed_seq).reshape((-1,30))。
#输入模型得到预测结果。
y=lstm_model.predict(seed_seq).reshape((-1,))。
#概率用小数表示。
y=np.exp(np.log(y+1e-6)/temperature)/np.sum(np.exp(np.log(y+1e-6)/temperature))。
#抽取概率最大的前500个字符。
np.random.shuffle(y)。
y=y[:500]。
#根据概率分布预测字符。
ind=np.random.choice(len(y),size=1,p=y)[0]。
#预测字符的概率。
prob=y[ind]。
#转换成字符。
pred=indict[ind]。
print('predicted character:',pred,'with probability: ',prob)。
return pred。
def cut_word(text):。
return list(jieba.cut(text))。
#分词后的文章。
text_cut=cut_word(text)。
#循环生成文章。
for i in range(800):。
seed=' '.join(text_cut)。
next_word=lstm_predict(seed,1,1)。
text_cut.append(next_word)]]。
titles := []string{Title2023 DramaExam}。
// 需要生成的文章数量。
totalStr := "1"。
total, err := strconv.ParseInt(totalStr, 10, 64)。
if err != nil {。
panic(err)。
// 需要生成的文章标题。
title := titles[0]。
// 文章内容。
2023戏剧考研名词解释检场content := `。
检场:专业演员在参加全国艺术类戏剧考研之前,需要在山东省艺术类高校戏剧专业课程考试检场参加考试。为了确保考试的公正、公平、有效进行,检场的设置是根据戏剧考研考试大纲的要求,专业演员的戏剧专业能力和考试科目来确定。
准考证号:专业演员在参加戏剧考研考试时,需要准备好准考证号。准考证号是每个考生的个人信息标识,是由考试机构根据考生的报名信息确定的。准考证号一般由考生姓名、性别、民族、出生日期、考试科目等组成。
// 生成指定长度的空格。
space := strings.Repeat(" ", 4)。
// 生成文章。
for i := int64(0); i < total; i++ {。
// 替换标题。
c := strings.ReplaceAll(content, Title2023DramaExam, title)。
// 替换空格。
c = strings.ReplaceAll(c, space, "")。
// 生成文章。
filename := GetFileName(i)。
filePath := GetArticleFilePath(Article2023DramaExamType, filename)。
2023戏剧考研名词解释检场
err := ioutil.WriteFile(filePath, []byte(c), 0644)。
if err != nil {。
panic(err)。
return cmd。
// Get2023DramaExamCmd get 2023dramaexam cmd。
func Get2023DramaExamCmd() *cobra.Command {。
cmd := &cobra.Command{。
Use: "2023dramaexam",。
Short: " generate 2023dramaexam articles",。
Run: func(cmd *cobra.Command, args []string) {。
fmt.Println("generate 2023dramaexam articles")。
cmd.AddCommand(get2023dramaexamTypeCmd())。
cmd.AddCommand(get2023dramaexam7Cmd())。
cmd.AddCommand(get2023dramaexam8Cmd())。
cmd.AddCommand(get2023dramaexam9Cmd())。
cmd.AddCommand(get2023dramaexam10Cmd())。
return cmd。
相关文章
2022戏剧考研名词解释检场
网络整理 · 06-15
2022年黑龙江4月自学考试准考证打印时间
网络整理 · 06-15
2022年非全日制研究生报考条件
网络整理 · 06-15
2022新东方经济学考研
网络整理 · 06-15
2022年自考考生可以报名参加法律职业资格考试吗
网络整理 · 06-15
2022年湖南大学土木工程学院招收推荐免试攻读研究生(含硕
网络整理 · 06-14