GithubHelp home page GithubHelp logo

attention-translation-keras's People

Contributors

divamgupta 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

attention-translation-keras's Issues

Getting incorrect dimensions

I followed the exact commands mentioned in your readme and before training i am getting the following errors

ValueError: Error when checking target: expected time_distributed_1 to have 3 dimensions, but got array with shape (1120, 40005)

Facing error while trying to create the preprocess data

Facing error while trying to create the preprocess data

python prep_data.py --text_A="data/parallel/IITB.en-hi.en" --text_B="data/parallel/IITB.en-hi.hi" --out_file="./data/nmt_hi_en_prepped.h5"
C:\Users\f.fernandes\AppData\Local\Programs\Python\Python36\lib\site-packages\h5py_init_.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "prep_data.py", line 16, in
eng_sents = (open( args.text_A ).read()).split("\n")[:-1]
File "C:\Users\f.fernandes\AppData\Local\Programs\Python\Python36\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 38387: character maps to

After modifying the files by adding encoding now faced with a new error
eng_sents = (open( args.text_A, encoding="utf8").read()).split("\n")[:-1]
hi_sents = (open( args.text_B, encoding="utf8").read()).split("\n")[:-1]

C:\F.Fernandes_DND_30Oct_Sidhartha\Francisco\Keras\data\attention-translation-keras-master>python prep_data.py --text_A="data/parallel/IITB.en-hi.en" --text_B="data/parallel/IITB.en-hi.hi" --out_file="./data/nmt_hi_en_prepped.h5"
C:\Users\f.fernandes\AppData\Local\Programs\Python\Python36\lib\site-packages\h5py_init_.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "prep_data.py", line 33, in
eng_sent_mat = getSentencesMat( eng_sents ,en_vocab , startEndTokens=True , tokenizer_fn=lambda x:x.split(' ') , maxSentenceL=100 )
File "C:\F.Fernandes_DND_30Oct_Sidhartha\Francisco\Keras\data\attention-translation-keras-master\utils.py", line 114, in getSentencesMat
tokenised = [ tokenise(s , startEndTokens=startEndTokens ,tokenizer_fn=tokenizer_fn ) for s in sentences ]
File "C:\F.Fernandes_DND_30Oct_Sidhartha\Francisco\Keras\data\attention-translation-keras-master\utils.py", line 114, in
tokenised = [ tokenise(s , startEndTokens=startEndTokens ,tokenizer_fn=tokenizer_fn ) for s in sentences ]
MemoryError

Thanks !

I was searching attention model implementation in keras. I have found your one. Can you tell me where did you get this implementation of attention model ?

Training and prediction

Hi Divam

How much time it takes to train and i have train it as it is and when making predictions giving a empty response for the same query "This is red".
I have one query

for ep in range( 100 ):
print ("Epoch" , ep)
m.fit_generator( tr_gen , steps_per_epoch=1000 , epochs=1 )
m.save_weights( args.weights_path + "." + str(ep) )
m.save_weights( args.weights_path )
what is ep,epochs,steps_per_epoch
denotes here
is it training on 1 epoch only

How visualize the attention weight

Thank you for the code. New to this area so I'm finding it difficult to understand these terminologies.
Can you help by providing /suggesting a way to visualize the attention weights.

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.