code: def CharNgramsEmbedding(
      n: int,
      max_chars: int,
      lower: bool,
      num_vectors: int,
      embed_dim: int,
      dropout: Optional[float],
  ) -> Model[List[str], thinc.types.Floats1d]:
      """
      Args:
          n
          max_chars
          lower
          num_vectors
          embed_dim
          dropout
      """
      with Model.define_operators({">>": chain}):
          model = (
              text_to_char_ngrams(n, max_chars, lower)
              >> thinc.layers.strings2arrays()
              >> thinc.layers.with_array(
                  thinc.layers.HashEmbed(
                      nO=embed_dim,
                      nV=num_vectors,
                      dropout=dropout,
                      column=0,
                  )
              )
              >> thinc.layers.list2ragged()
              >> thinc.layers.reduce_mean()
          )
      return model
  
file_path: textacy/src/textacy/lang_id/models.py
imports: from __future__ import annotations
  from typing import Callable, List, Optional, Sequence, Tuple
  import numpy
  import thinc
  import thinc.layers
  import thinc.types
  from cytoolz import itertoolz
  from thinc.api import Model, chain, concatenate
label_desc: Use image node_id 5 for calling a global function with example usage: CharNgramsEmbedding(n, max_chars, lower, num_vectors, embed_dim, dropout) and returns: model