class_docstr: Features highlighted in text. :document: is a pre-processed document
  before applying the analyzer. :weighted_spans: holds a list of spans
  for features found in text (span indices correspond to
  :document:). :preserve_density: determines how features are colored
  when doing formatting - it is better set to True for char features
  and to False for word features.
class_docstr_tok: ["Features","highlighted","in","text",".",":","document",":","is","a","pre-processed","document","before","applying","the","analyzer",".",":","weighted_spans",":","holds","a","list","of","spans","for","features","found","in","text","(","span","indices","correspond","to",":","document",":",")",".",":","preserve_density",":","determines","how","features","are","colored","when","doing","formatting","-","it","is","better","set","to","True","for","char","features","and","to","False","for","word","features","."]
code: def __init__(
      self,
      document,  # type: str
      spans,  # type: List[WeightedSpan]
      preserve_density=None,  # type: bool
      vec_name=None,  # type: str
  ):
      # type: (...) -> None
      self.document = document
      self.spans = spans
      self.preserve_density = preserve_density
      self.vec_name = vec_name
  
imports: from typing import Any, List, Tuple, Union, Optional
  import numpy
  from .base_utils import attrs
  from .formatters.features import FormattedFeatureName
label_desc: Use image node_id 1 to create a new DocWeightedSpans object from inherited base classes: object with example: obj = DocWeightedSpans(document, spans, preserve_density, vec_name)