divamgupta / attention-translation-keras Goto Github PK
View Code? Open in Web Editor NEWAttention based sequence to sequence neural machine translation model built in keras.
Attention based sequence to sequence neural machine translation model built in keras.
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
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
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 ?
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
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.
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.