Giter Site home page Giter Site logo

mta-lstm's People

Contributors

hit-computer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mta-lstm's Issues

README.md

word_vec.pkl file(this is word embedding) and word_vec.pkl file(vocabulary of text).

word_vec = cPickle.load(open('word_vec.pkl', 'r'))
vocab = cPickle.load(open('word_voc.pkl','r'))

Train.py Error: Dimensions must be equal,

Hello:

I use python 2.7 and tensor flow 1.4, when I run python Train.py, the following error occurs.

Could you please help me ? Thanks @hit-computer

The Error msg:

  Traceback (most recent call last):
  File "/Users/jiangwei/git/topic_essay/Train.py", line 260, in <module>
    tf.app.run()
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/Users/jiangwei/git/topic_essay/Train.py", line 235, in main
    m = Model(is_training=True, config=config, filename='coverage_data')
  File "/Users/jiangwei/git/topic_essay/Train.py", line 122, in __init__
    (cell_output, state) = cell(tf.concat([inputs[:, time_step, :], mt], axis=1), state) 
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 183, in __call__
    return super(RNNCell, self).__call__(inputs, state)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/layers/base.py", line 575, in __call__
    outputs = self.call(inputs, *args, **kwargs)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 1066, in call
    cur_inp, new_state = cell(cur_inp, cur_state)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 891, in __call__
    output, new_state = self._cell(inputs, state, scope)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 183, in __call__
    return super(RNNCell, self).__call__(inputs, state)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/layers/base.py", line 575, in __call__
    outputs = self.call(inputs, *args, **kwargs)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 611, in call
    lstm_matrix = self._linear1([inputs, m_prev])
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 1189, in __call__
    res = math_ops.matmul(array_ops.concat(args, 1), self._weights)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py", line 1891, in matmul
    a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 2437, in _mat_mul
    name=name)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2958, in create_op
    set_shapes_for_outputs(ret)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2209, in set_shapes_for_outputs
    shapes = shape_func(op)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2159, in call_with_requiring
    return call_cpp_shape_fn(op, require_shape_fn=True)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn
    require_shape_fn)
  File "/Users/jiangwei/anaconda/envs/tensorflow-1.4-py2.7/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl
    raise ValueError(err.message)
ValueError: Dimensions must be equal, but are 40 and 220 for 'model/RNN/RNN_sentence/RNN_sentence/multi_rnn_cell/cell_0/cell_0/lstm_cell/MatMul_1' (op: 'MatMul') with input shapes: [16,40], [220,80].

Process finished with exit code 1

The config file is

    class Config(object):
    data_dir = 'Data/'
    #vec_file = 'Data/wiki-zh.word2vec.txt'
    vec_file = 'Data/TrainingData.word2vec.txt'
    init_scale = 0.04
    learning_rate = 0.001
    max_grad_norm = 10 #gradient clipping
    num_layers = 2
    num_steps = 151 
    hidden_size = 20
    #word_embedding_size = 10
    word_embedding_size = 100
    max_epoch = 30
    max_max_epoch = 80
    keep_prob = 0.5 #The probability that each element is kept through dropout layer
    lr_decay = 1.0
    batch_size = 16 
    vocab_size = 92161 
    num_keywords = 5
    save_freq = 10 #The step (counted by the number of iterations) at which the model is saved to hard disk.
    model_path = './Model_News' #the path of model that need to save or load
    
    # parameter for generation
    len_of_generation = 16 #The number of characters by generated
    save_time = 20 #load save_time saved models
    is_sample = True #true means using sample, if not using argmax
    BeamSize = 2

Invalid/Expired data link

Hi

I tried to download the data provided in the readme but it says the page does not exist or expired. Could you please check the data link? Thanks
2018-11-28 2 33 32

Novice problem

I would like to ask which directory the data files of the two datasets are located in.

About Dataset

请问有人下载好了数据集吗?求分享~谢谢

Readme error

In the README.md:

word_vec.pkl file(this is word embedding) and word_vec.pkl file(vocabulary of text).

the second word_vec.pkl should be word_voc.pkl

@hit-computer

Thanks, a great work!

training time

Hi,
I read your paper a few weeks ago, it is a brilliant idea. I'd like to train a model with the dataset you provided. But my computing power is limited. Could you suggest how long it takes when you performed it and the platform (#gpus, or #cpus, and memory) you were working with?
Thanks!

word2vec binary not supported

Just heads up for who else will use this later.
When you use gensim to train word2vec model, plz save it to not binary type. Otherwise, it will raise decode problem when running Preprocess.py.

Can the beam search be parallel?

The beam search code can only use for single generation each time, but for evaluation it can costs lots time. Can anybody help make it parallel? Thx a lot.

TrainingData.txt and vec.txt. How to create these file?

Dear hit-computer

I m' newbie. I read your readme and do not understand how to create TrainingData.txt and vec.txt from Composition Data Set and Zhihu Data Set.
Please help me.
I found new version of your code, but i thing i need understand this version before read new version.

关于zhihu数据集

zhihu数据集上面很多话题不再段落当中,没办法使用语言模型,请问这些话题的词向量是怎么得到的,而且有很多,

关于代价函数

请问一下第二个cost2是什么意思啊,不明白为什么是两种权重的差值的平方

could you share your model file?

冒昧的问一句,能否分享下您们的model文件。这样我们在不用train的情况下,也能尝试效果,非常感谢

Pretrained model file

I want to generate some essays using the pretrained model. Can you please send me the pretrained model file and two files: word_vec.pkl and word_voc.pkl ?

关于词典

请问一下你们的词典真的只用了5万个吗,那不是会出现很多unk?我不清楚这5万个词是只作为预测的候选词还是所有的词典,我看那个作文的数据集有几十万个词,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.