目录
如果有一个经过训练的模型,接下来就可以对其进行预测:
sample_1="""
I hate that the dismal weather had me down for so long,when will it break! Ugh,when does happiness return? The sun is blinding and the puffy clouds are too thin. I can't wait for the weekend.
"""
from keras.api.models import model_from_json
with open("simplernn_model1.json","r") as json_file:
json_string=json_file.read()
model=model_from_json(json_string)
model.load_weights('simplernn_weights1.h5')
vec_list=tokenize_and_vectorize([(1,sample_1)])
test_vec_list=pad_turnc(vec_list,maxlen)
test_vec=np.reshape(test_vec_list,(len(test_vec_list),maxlen,embedding_dims))
print(model.predict_classes(test_vec))
![]()
结果是负向的。
我们又有了一个可以添加到流水线中的工具&#

最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



