machine-translation

Add attention layer to Seq2Seq model

混江龙づ霸主 提交于 2020-06-27 17:33:09
问题 I have build a Seq2Seq model of encoder-decoder. I want to add an attention layer to it. I tried adding attention layer through this but it didn't help. Here is my initial code without attention # Encoder encoder_inputs = Input(shape=(None,)) enc_emb = Embedding(num_encoder_tokens, latent_dim, mask_zero = True)(encoder_inputs) encoder_lstm = LSTM(latent_dim, return_state=True) encoder_outputs, state_h, state_c = encoder_lstm(enc_emb) # We discard `encoder_outputs` and only keep the states.

google translator toolkit - how to exclude portions of the text from being processed

一个人想着一个人 提交于 2020-06-23 08:28:08
问题 Does anybody know whether there is a possiblity to exclude portions of a text from being processed by the google translator toolkit? A great advantage of this tool is that it suggests the translations of sentences which have already been translated in another context. However, if any additional footnote and/or remark has been added to the text, it won't be recognized as a match. I am looking for a possibility to enclose such text in "brackets" within which it will be ignored. For example, the

Incompatible shapes: [128,37] vs. [128,34]

心不动则不痛 提交于 2020-06-16 06:38:07
问题 I have added attention layer in an LStM model for encoder-decoder. The model.fit function history = model.fit_generator(generator = generate_batch(X_train, y_train, batch_size = batch_size), steps_per_epoch = train_samples//batch_size, epochs=epochs, validation_data = generate_batch(X_test, y_test, batch_size = batch_size), validation_steps = val_samples//batch_size) And this is the error I am getting ---------------------------------------------------------------------------

Resources for programs teaching natural languages

笑着哭i 提交于 2019-12-25 18:28:23
问题 What API's and data sets are available for use in programs to teach natural languages e.g. to aid in learning to read/write/listen/speak a 2nd language? These could be web or traditional API's to dictionaries, translation services, associations of words / concepts to images, sounds e.g. spoken words or phrases, movies, or sets of flashcard decks. Also of interest are websites that could be spidered to obtain local data sets for offline use. As a start, I note that that the Google translate

Getting alignment/attention during translation in OpenNMT-py

时光毁灭记忆、已成空白 提交于 2019-12-20 05:42:20
问题 Does anyone know how to get the alignments weights when translating in Opennmt-py? Usually the only output are the resulting sentences and I have tried to find a debugging flag or similar for the attention weights. So far, I have been unsuccessful. 回答1: You can get the attention matrices. Note that it is not the same as alignment which is a term from statistical (not neural) machine translation. There is a thread on github discussing it. Here is a snippet from the discussion. When you get the

Is there a tutorial about giza++? [closed]

隐身守侯 提交于 2019-12-17 22:34:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . The Urls in its 'readme' file is not valid (http://www.fjoch.com/mkcls.html and http://www.fjoch.com/GIZA++.html). Is there a good tutorial about giza++? Or is there some alternatives that have complete documentation? 回答1: The following is excerpted from a tutorial I'm putting together for a class. (NB: This

What is currently the best way to add a custom dictionary to a neural machine translator that uses the transformer architecture?

依然范特西╮ 提交于 2019-12-11 15:56:32
问题 It's common to add a custom dictionary to a machine translator to ensure that terminology from a specific domain is correctly translated. For example, the term server should be translated differently when the document is about data centers, vs when the document is about restaurants. With a transformer model, this is not very obvious to do, since words are not aligned 1:1. I've seen a couple of papers on this topic, but I'm not sure which would be the best one to use. What are the best

WooCommerce - Translate a word on the Checkout page

ぃ、小莉子 提交于 2019-12-10 17:42:30
问题 I'm trying to translate a word on the WooCommerce checkout page. My website is in the Dutch language, but they translated it poorly, so I want to use a different word. What needs to be translated It concerns the following line: "Totaal €469,38 (Inclusief €79,38 Belasting )" In English this says: "Total €469,38 (Includes €79,38 tax )" It's the line that sums up the total amount of the order. And I want to translate the word 'Belasting' to 'BTW'. What I've tried Checked out settings in

Create translation web services in java?

泪湿孤枕 提交于 2019-12-08 10:38:06
问题 Create XML base with words? When a client requires a particular word in the translation, the service checks for the word in its XML-based If there is a word, service as an output to the client broadcast a translated word. If the word does not exist in the XML file, the service broadcasts adequate message. Because testing in an XML file you need to add a few words. Client benefits described service by calling the method translate, three string parameters. Example: translate(”butterfly”,

How to get phrase tables from word alignments?

僤鯓⒐⒋嵵緔 提交于 2019-12-08 04:50:07
问题 The output of my word alignment file looks as such: I wish to say with regard to the initiative of the Portuguese Presidency that we support the spirit and the political intention behind it . In bezug auf die Initiative der portugiesischen Präsidentschaft möchte ich zum Ausdruck bringen , daß wir den Geist und die politische Absicht , die dahinter stehen , unterstützen . 0-0 5-1 5-2 2-3 8-4 7-5 11-6 12-7 1-8 0-9 9-10 3-11 10-12 13-13 13-14 14-15 16-16 17-17 18-18 16-19 20-20 21-21 19-22 19-23