refactor: merge multiple project into one and create new project
This commit is contained in:
16
dl-exp/exp3/source/eval.py
Normal file
16
dl-exp/exp3/source/eval.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#ANLI College of Artificial Intelligence
|
||||
|
||||
|
||||
import tensorflow as tf
|
||||
from dataset import tokenizer
|
||||
import settings
|
||||
import utils
|
||||
|
||||
# 加载训练好的模型
|
||||
model = tf.keras.models.load_model(settings.BEST_MODEL_PATH)
|
||||
# 随机生成一首诗
|
||||
print(utils.generate_random_poetry(tokenizer, model))
|
||||
# 给出部分信息的情况下,随机生成剩余部分
|
||||
print(utils.generate_random_poetry(tokenizer, model, s='床前明月光,'))
|
||||
# 生成藏头诗
|
||||
print(utils.generate_acrostic(tokenizer, model, head='好好学习天天向上'))
|
||||
Reference in New Issue
Block a user