Body: <p>Suppose there are <span class="math-container">$m$</span> sentences in a text file and the number of distinct words is equal to <span class="math-container">$n$</span>. The goal is to get word embeddings using RNN.</p>
  <p>We know that it is impossible to pass any word, which is in text format, as an input to RNN. We need to convert each word into some number and then pass it to the RNN to get word embeddings.</p>
  <p>I know only the following method, if correct:</p>
  <ol>
  <li>Assign an index to each word. So, the index ranges from <span class="math-container">$0$</span> to <span class="math-container">$n-1$</span>.</li>
  <li>Use the indices as input to RNN.</li>
  </ol>
  <p>Is it the only technique used in the literature? If not, what are the names of other techniques that are used in the context of RNN encoders?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-15T10:35:19.800Z
Comments.Text: I don't understand why you're asking this question. What's the problem with having a one-to-one mapping between integers and words in the vocabulary in order to retrieve the embeddings?
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-15T13:31:29.287Z
Comments.Text: @nbro I don't know whether it is the only method or it is one of the method of passing text input to rnn.
Comments.UserDisplayName: hanugm
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-16T00:09:13.773Z
Comments.Text: @nbro I want to know if there exist other methods.
Comments.UserDisplayName: hanugm
Tags: <natural-language-processing><recurrent-neural-networks><word-embedding>
Title: What are the types of inputs used for RNN in literature given sentences?
UserDisplayName: hanugm
ThreadText: # What are the types of inputs used for RNN in literature given sentences?
  
  (Asked by: username_0 on 2021-12-12)
  
  Suppose there are $m$ sentences in a text file and the number of distinct words is equal to $n$. The goal is to get word embeddings using RNN.
  
  We know that it is impossible to pass any word, which is in text format, as an input to RNN. We need to convert each word into some number and then pass it to the RNN to get word embeddings.
  
  I know only the following method, if correct:
  
  1. Assign an index to each word. So, the index ranges from $0$ to $n-1$.
  2. Use the indices as input to RNN.
  
  Is it the only technique used in the literature? If not, what are the names of other techniques that are used in the context of RNN encoders?
  
  **Tags:** natural-language-processing, recurrent-neural-networks, word-embedding
  
  > **Comments:**
  > **username_1**: I don't understand why you're asking this question. What's the problem with having a one-to-one mapping between integers and words in the vocabulary in order to retrieve the embeddings?  
  > **username_0**: @username_1 I don't know whether it is the only method or it is one of the method of passing text input to rnn.  
  > **username_0**: @username_1 I want to know if there exist other methods.  
  
  ---
  
  ## 0 answers
  
  