class_docstr: Main data class: encapsulate list of utterances, mentions and speakers
  Process utterances to extract mentions and pre-compute mentions features
docstr: Compute features for the extracted mentions
docstr_tok: ["Compute","features","for","the","extracted","mentions"]
code: def set_mentions_features(self):
      """
      Compute features for the extracted mentions
      """
      doc_embedding = (
          self.embed_extractor.get_document_embedding(self.utterances)
          if self.embed_extractor is not None
          else None
      )
      for mention in self.mentions:
          one_hot_type = np.zeros((4,))
          one_hot_type[mention.mention_type] = 1
          features_ = {
              "01_MentionType": mention.mention_type,
              "02_MentionLength": len(mention) - 1,
              "03_MentionNormLocation": (mention.index)
              / len(self.mentions),
              "04_IsMentionNested": 1
              if any(
                  (
                      m is not mention
                      and m.utterances_sent == mention.utterances_sent
                      and m.start <= mention.start
                      and mention.end <= m.end
                  )
                  for m in self.mentions
              )
              else 0,
          }
          features = np.concatenate(
              [
                  one_hot_type,
                  encode_distance(features_["02_MentionLength"]),
                  np.array(
                      features_["03_MentionNormLocation"],
                      ndmin=1,
                      copy=False,
                  ),
                  np.array(
                      features_["04_IsMentionNested"],
                      ndmin=1,
                      copy=False,
                  ),
              ],
              axis=0,
          )
          (
              spans_embeddings_,
              words_embeddings_,
              spans_embeddings,
              words_embeddings,
          ) = self.embed_extractor.get_mention_embeddings(
              mention, doc_embedding
          )
          mention.features_ = features_
          mention.features = features
          mention.spans_embeddings = spans_embeddings
          mention.spans_embeddings_ = spans_embeddings_
          mention.words_embeddings = words_embeddings
          mention.words_embeddings_ = words_embeddings_
  
imports: import re
  import io
  from six import string_types, integer_types
  from spacy.tokens import Span, Token
  from neuralcoref.train.compat import unicode_
  from neuralcoref.train.utils import encode_distance, parallel_process
  import spacy
  import numpy
label_desc: Use image node_id 10 for calling the Document obj's underlying member method code with example usage: obj.set_mentions_features() without return types