class_docstr: Receives bert contextual embeddings of a text, extracts all the
  possible mentions in that text. 
class_docstr_tok: ["Receives","bert","contextual","embeddings","of","a","text",",","extracts","all","the","possible","mentions","in","that","text","."]
docstr: Args:
      doc: document information
  
  Returns:
      torch.Tensor of shape [n_word], containing cluster indices for
          each word. Non-coreferent words have cluster id of zero.
docstr_tok: ["Args",":","doc",":","document","information","Returns",":","torch.Tensor","of","shape","[","n_word","]",",","containing","cluster","indices","for","each","word",".","Non-coreferent","words","have","cluster","id","of","zero","."]
code: def _cluster_ids(self, doc: Doc) -> torch.Tensor:
      """
      Args:
          doc: document information
  
      Returns:
          torch.Tensor of shape [n_word], containing cluster indices for
              each word. Non-coreferent words have cluster id of zero.
      """
      word2cluster = {
          word_i: i
          for i, cluster in enumerate(doc["word_clusters"], start=1)
          for word_i in cluster
      }
  
      return torch.tensor(
          [
              word2cluster.get(word_i, 0)
              for word_i in range(len(doc["cased_words"]))
          ],
          device=self.device,
      )
  
file_path: stanza/stanza/models/coref/word_encoder.py
imports: from typing import Tuple
  import torch
  from stanza.models.coref.config import Config
  from stanza.models.coref.const import Doc
label_desc: Use image node_id 5 for calling the WordEncoder obj's underlying member method code with example usage: obj._cluster_ids(doc) and returns: torch