class_docstr: Class for detecting language of text.
class_docstr_tok: ["Class","for","detecting","language","of","text","."]
docstr: Map list of strings to batch tensor. Assumed all docs are same length.
docstr_tok: ["Map","list","of","strings","to","batch","tensor",".","Assumed","all","docs","are","same","length","."]
code: def _text_to_tensor(self, docs):
      """
      Map list of strings to batch tensor. Assumed all docs are same length.
      """
  
      device = next(self._model.parameters()).device
      all_docs = []
      for doc in docs:
          doc_chars = [
              self._char_index.get(c, self._char_index["UNK"])
              for c in list(doc)
          ]
          all_docs.append(doc_chars)
      return torch.tensor(all_docs, device=device, dtype=torch.long)
  
file_path: stanza/stanza/pipeline/langid_processor.py
imports: import emoji
  import re
  import stanza
  import torch
  from stanza.models.common.doc import Document
  from stanza.models.langid.model import LangIDBiLSTM
  from stanza.pipeline._constants import *
  from stanza.pipeline.processor import UDProcessor, register_processor
label_desc: Use image node_id 2 for calling the LangIDProcessor obj's underlying member method code with example usage: obj._text_to_tensor(docs) and returns: torch