SoftWiser-group / iTag

Implementation of An Integral Tag Recommendation Model for Textual Content.
10 stars 3 forks source link

itag.h5 file not found #5

Open maral1988 opened 5 years ago

maral1988 commented 5 years ago

Hi I am trying to run itag on windows . after gathering and preproccessing data Now I run itag.py but there is a runtime error :

 File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5f.pyx", line 85, in h5py.h5f.open
 OSError: Unable to open file (unable to open file: name = 'itag.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

should I create h5 file first? thanks

Tangworld commented 5 years ago

You could comment out line 144 because itag.h5 is used to save the result of training, and line 141 model.fit() will create itag.h5. And maybe you should learn more about Keras. Best wishes

maral1988 commented 5 years ago

Thanks. Yes I'm new to keras and deep Learning. Now there is an error in this line : prs, weights, pgen, en_st1, en_st2, en_st3 = decoder_model.predict([current, full_context, en_st1, en_st2, en_st3]) in itag.py . error: InvalidArgumentError (see above for traceback): indices[0,0] = 20705 is not in [0, 20705) Do you any idea about it? thank you very much

maral1988 commented 5 years ago

And this the output before training:

   1 28 17.90344827586207

2 2 2.0 unique_words: 1511 common: 0 unique_tags: 0 index: 1514 tags index: 1514 shared_index: 1514 tag from : 1514 sfs end: 1514 sfs start: 1515 Train on 234 samples, validate on 27 samples Epoch 1/60

Tangworld commented 5 years ago

Well, you used your own data, so you should update parameters(line16-line38).

ALL_WORDS : total amount of words and tags WORD_VOCAB: amount of words in texts LABEL_VOCAB: amount of tags DE_TOKENS = LABEL_VOCAB - 2 # remove pad and start tokens from file_vocab MAX_WORDS: the max length of texts MAX_LABELS: the max length of tags INDEX_FROM = 3 END_TOKEN : 'sfs end' in the output START_TOKEN: 'sfs start' in the output LABEL_FROM: 'tag from' in the output GRU_SIZE = 256 ATTENTION_SIZE = 256 EMBEDDING_DIM = 100 KEEP_PROB = 0.1 NUM_EPOCHS = 60 BATCH_SIZE = 100 TOPIC_NUM = 100 BEAM_SIZE = 3 MAX_LENGTH = 5

maral1988 commented 5 years ago

That's ok thanks

maral1988 commented 5 years ago

I got confused about some of theses parameters. could you please calulate these parameters for this simple example ?

text1 : I love python #python text2 : python is wonderful #python text3 : deep learning is amazing #deep_learning

thank you very very very much