title: How to set multiple sequences as features in KERAS
body: <p>I want to make Named Entity Recognition model with Keras.
  These are the links that I have followed:</p>
  <p><a href="https://valueml.com/named-entity-recognition-using-lstm-in-keras/" rel="nofollow noreferrer">https://valueml.com/named-entity-recognition-using-lstm-in-keras/</a>
  <a href="https://djajafer.medium.com/named-entity-recognition-and-classification-with-keras-4db04e22503d" rel="nofollow noreferrer">https://djajafer.medium.com/named-entity-recognition-and-classification-with-keras-4db04e22503d</a></p>
  <p>Data looks like this:</p>
  <pre><code>                word label
  0          Thousands     O
  1                 of     O
  2      demonstrators     O
  3               have     O
  4            marched     O
  ...              ...   ...
  44187          there     O
  44188   accidentally     O
  44189             or     O
  44190   deliberately     O
  44191              .     O
  </code></pre>
  <p>They are using word to vectors, so they are indexing the words and labels, so that <code>X</code> are my features (index sequences of words) and <code>y</code> are my results (index sequences of labels):</p>
  <pre><code>max_len = 30
  X = [[word2idx[w[0]] for w in s] for s in list_of_sentances]
  X = pad_sequences(maxlen=max_len, sequences=X, padding=&quot;post&quot;, value=num_words-1)
  
  y = [[label2idx[w[1]] for w in s] for s in list_of_sentances]
  y = pad_sequences(maxlen=max_len, sequences=y, padding=&quot;post&quot;, value=label2idx[&quot;O&quot;])
  y = [to_categorical(i, num_classes=num_labels) for i in y]
  </code></pre>
  <p>But what if I have dataset like this:
  <a href="https://i.stack.imgur.com/pd9wh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pd9wh.png" alt="enter image description here" /></a></p>
  <p>here I have another column and that is <code>POS</code>. How can I add values of <code>POS</code> column to my features?
  So basically, I do not want only <code>word</code> values in my X, i also want <code>POS</code> values in my X. *(or any other values)
  What If I have multiple columns, such as:</p>
  <pre><code>word
  POS
  is_capital_letter
  word_length
  </code></pre>
  <p>...</p>
  <p>How can I add all of these columns to my features?</p>
  <p>This is my model:
  X = np.array(X)
  y = np.array(y)</p>
  <pre><code>x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=1)
  
  print(&quot;x_train shape&quot;, x_train.shape)
  print(&quot;x_test shape&quot;, x_test.shape)
  #x_train shape (750, 75)
  #x_test shape (250, 75)
  
  
  input_word = Input(shape=(max_len,))
  
  model = Embedding(input_dim = vocab_len+1, output_dim = 75, input_length = max_len)(input_word)
  model = SpatialDropout1D(0.25)(model)
  model = Bidirectional(LSTM(units = 25, return_sequences=True, recurrent_dropout = 0.2))(model)
  out = TimeDistributed(Dense(num_labels, activation = &quot;softmax&quot;))(model)
  
  model = Model(input_word, out)
  </code></pre>