Answers.Body: <p>The training examples are not mentioned, but, assuming the assignment involves supervised learning, normalization is, in this case, mapping the inputs and outputs to binary values.</p>
  
  <p>Translation, in this simplified context, is a map of strings to strings, which isn't really an AI device by contemporary standards. Since an artificial network is given as a requirement for the solution, the goal is to train the network to act like a hash map.</p>
  
  <p><span class="math-container">$$ \Big\{..., \;
  \big(
  [\text{"beer", "birra", "cervexa"}]:
  \text{"pivo"}
  \big)
  , \; ...\Big\} $$</span></p>
  
  <p><span class="math-container">$$ \Downarrow $$</span></p>
  
  <p><span class="math-container">$$ \Big\{..., \; \big(\text{"beer" : "pivo"}), (\text{"birra" : "pivo"}), (\text{"cervexa" : "pivo"}\big), \; ...\Big\} $$</span></p>
  
  <p>Assuming there is a list of pairs <span class="math-container">$(\mathcal{X}, \mathcal{Y})$</span>, where <span class="math-container">$\mathcal{X}$</span> is the word in any of the source languages and <span class="math-container">$\mathcal{Y}$</span> is the word in the target language, and the vocabulary of both is known to have word counts of <span class="math-container">$X$</span> and <span class="math-container">$Y$</span> respectively, one can determine the input and output layer widths (cell counts) <span class="math-container">$w_1$</span> and <span class="math-container">$w_{\ell}$</span>, where <span class="math-container">$\ell$</span> is the number of network layers.</p>
  
  <p><span class="math-container">$$w_1 = \text{ceiling} ( \log_2{X} )$$</span>
   <span class="math-container">$$w_{\ell} = \text{ceiling} ( \log_2{Y} )$$</span></p>
  
  <p>The assignment of source words to binary values is arbitrary. You can sort them by language and then by whatever common character encoding used (such as UTF-8) just for debugging purposes. The same is true of target words.</p>
  
  <p>A simple MLP (multi-layer perceptron) with mini-batch training using basic propagation map be appropriate.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-27T23:19:10.430Z
Answers.LastActivityDate: 2018-12-27T23:19:10.430Z
Answers.UserDisplayName: Douglas Daseeco
Answers.Body: <p>So, the <code>normalization</code> as you call it is just encoding the word into some vector of fixed length. After you encode it, you should be able to decode it and match the words. You should google a little, for a <code>seq2seq</code> problems and <code>Encoder/Decoder</code> structure. There are encoder-decoder frameworks out there and lots of resources. You don't care about a language so just pretend that words like "beer" and "birra" have the same meaning in Croatian and in this case, it is "pivo".</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-18T20:25:56.540Z
Answers.LastActivityDate: 2018-12-18T20:25:56.540Z
Answers.UserDisplayName: Igor 
Body: <p>I've been given an assignment to create a neural network that will suggest a Croatian word for a word given in any other European language (out of those found <a href="https://www.indifferentlanguages.com/words/beer" rel="nofollow noreferrer">here</a>). The words are limited to drinks you can find on a bar menu.</p>
  
  <p>I've looked at many NN examples, both simple and complex, but I'm having trouble with understanding how to normalize the input.</p>
  
  <p>For example, words "beer", "birra" and "cervexa" should all translate to "pivo". If I include those 3 in the training set, and after the network has finished training I input the word "bier", the output should be "pivo" again.</p>
  
  <p>I'm not looking for a working solution to this problem, I just need a nudge in the right direction regarding normalization.</p>
  
Tags: <neural-networks>
Title: Translating a single word Neural Networks
UserDisplayName: David Kiš
ThreadText: # Translating a single word Neural Networks
  
  (Asked by: username_0 on 2018-12-18)
  
  I've been given an assignment to create a neural network that will suggest a Croatian word for a word given in any other European language (out of those found [here](https://www.indifferentlanguages.com/words/beer)). The words are limited to drinks you can find on a bar menu.
  
  I've looked at many NN examples, both simple and complex, but I'm having trouble with understanding how to normalize the input.
  
  For example, words "beer", "birra" and "cervexa" should all translate to "pivo". If I include those 3 in the training set, and after the network has finished training I input the word "bier", the output should be "pivo" again.
  
  I'm not looking for a working solution to this problem, I just need a nudge in the right direction regarding normalization.
  
  **Tags:** neural-networks
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-12-27. Score: 1
  
  The training examples are not mentioned, but, assuming the assignment involves supervised learning, normalization is, in this case, mapping the inputs and outputs to binary values.
  
  Translation, in this simplified context, is a map of strings to strings, which isn't really an AI device by contemporary standards. Since an artificial network is given as a requirement for the solution, the goal is to train the network to act like a hash map.
  
  $$ \Big\{..., \;
  \big(
  [\text{"beer", "birra", "cervexa"}]:
  \text{"pivo"}
  \big)
  , \; ...\Big\} $$
  
  $$ \Downarrow $$
  
  $$ \Big\{..., \; \big(\text{"beer" : "pivo"}), (\text{"birra" : "pivo"}), (\text{"cervexa" : "pivo"}\big), \; ...\Big\} $$
  
  Assuming there is a list of pairs $(\mathcal{X}, \mathcal{Y})$, where $\mathcal{X}$ is the word in any of the source languages and $\mathcal{Y}$ is the word in the target language, and the vocabulary of both is known to have word counts of $X$ and $Y$ respectively, one can determine the input and output layer widths (cell counts) $w\_1$ and $w\_{\ell}$, where $\ell$ is the number of network layers.
  
  $$w\_1 = \text{ceiling} ( \log\_2{X} )$$
  $$w\_{\ell} = \text{ceiling} ( \log\_2{Y} )$$
  
  The assignment of source words to binary values is arbitrary. You can sort them by language and then by whatever common character encoding used (such as UTF-8) just for debugging purposes. The same is true of target words.
  
  A simple MLP (multi-layer perceptron) with mini-batch training using basic propagation map be appropriate.
  
  
  ---
  
  ### Answer by username_2 on 2018-12-18. Score: 0
  
  So, the `normalization` as you call it is just encoding the word into some vector of fixed length. After you encode it, you should be able to decode it and match the words. You should google a little, for a `seq2seq` problems and `Encoder/Decoder` structure. There are encoder-decoder frameworks out there and lots of resources. You don't care about a language so just pretend that words like "beer" and "birra" have the same meaning in Croatian and in this case, it is "pivo".
  
  
  ---
  
  