xiaoyuanyi / wmpoetry Goto Github PK
View Code? Open in Web Editor NEWThe source codes of Working Memory model for Chinese poetry generation (IJCAI 2018).
The source codes of Working Memory model for Chinese poetry generation (IJCAI 2018).
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): win10 x86
TensorFlow installed from (source or binary): anaconda
TensorFlow version: 1.14.0
Python version: 3.7.4
I downloaded the data files supported by you, when I began step4.2(Keywords Extraction and Genre Pattern Building), it always showed that 'gbk' can't decode \xxx in line xx. So I tried to change the read-file way in the source. Like this:
Before:
fin = open(file_path, 'r')
After:
fin = open(file_path, 'r',encoding='utf-8')
It works, errors have gone when I changed all the places where it gave a decoding error.
But at the end of pre-training, it showed that "Python3 didn't work" with a dialogue box. And the code showed at last are following, And there hasn't a fold named 'premodel' in WMPoetry\wm, can you help me?
...
...
不辞朝谒远 # 唯要近慈恩 # 唯有信慈亲 #
epoch: 1, 8400/8607 97.607%, 0.282 s per iter
train loss: 3.806 ppl:44.96, l2 loss: 17243.167, lr:0.0010.
______________________
今朝复相见 # 疑是葛仙翁 # 留是后天翁 #
epoch: 1, 8600/8607 99.930%, 0.284 s per iter
train loss: 3.773 ppl:43.52, l2 loss: 17536.656, lr:0.0010.
______________________
0.0010 to 0.0010
run validation...
validation epoch: 1 loss: 5.679 ppl: 292.55, l2 loss: 30140.641
saving model...
WARNING:tensorflow:*******************************************************
W0518 15:41:08.506486 15588 saver.py:1134] *******************************************************
WARNING:tensorflow:TensorFlow's V1 checkpoint format has been deprecated.
W0518 15:41:08.507480 15588 saver.py:1135] TensorFlow's V1 checkpoint format has been deprecated.
WARNING:tensorflow:Consider switching to the more efficient V2 format:
W0518 15:41:08.509477 15588 saver.py:1136] Consider switching to the more efficient V2 format:
WARNING:tensorflow: `tf.train.Saver(write_version=tf.train.SaverDef.V2)`
W0518 15:41:08.510476 15588 saver.py:1137] `tf.train.Saver(write_version=tf.train.SaverDef.V2)`
WARNING:tensorflow:now on by default.
W0518 15:41:08.511476 15588 saver.py:1138] now on by default.
WARNING:tensorflow:*******************************************************
W0518 15:41:08.512475 15588 saver.py:1139] *******************************************************
Windows fatal exception: access violation
Current thread 0x00003ce4 (most recent call first):
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\tensorflow\python\client\session.py", line 1429 in _call_tf_sessionrun
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\tensorflow\python\client\session.py", line 1341 in _run_fn
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\tensorflow\python\client\session.py", line 1356 in _do_call
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\tensorflow\python\client\session.py", line 1350 in _do_run
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\tensorflow\python\client\session.py", line 1173 in _run
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\tensorflow\python\client\session.py", line 950 in run
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\tensorflow\python\training\saver.py", line 1173 in save
File "pretrain.py", line 244 in train
File "pretrain.py", line 251 in main
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\absl\app.py", line 250 in _run_main
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\absl\app.py", line 299 in run
File "C:\Users\Alice\Miniconda3\envs\tflearning\lib\site-packages\tensorflow\python\platform\app.py", line 40 in run
File "pretrain.py", line 254 in <module>
这个模型真的超级复杂代码逻辑看不懂^_^我都想写个pytorch版本
您好!请问切分各种类型古诗词的分词工具可不可以也开源出来呢?谢谢!
您好,在拜读您的代码的过程中遇到了几个问题,希望可以请教一下您。
您好!请问generate_base.py的228行~234行用的indices是否与原先不对应,这样用indices索引出的结果是没有意义的?因为indices是新的候选序列的下标列表。
您好,没太明白这个文件中每个词的tfidf是怎么来的。看tfidf的定义,不是要指定一篇文章,这篇文章中的某个词的重要度吗?但是这里的话就是一个词,一个tfidf。希望大佬能解释下,谢谢~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.