Compute and set ``target_expl.weighted_spans`` attribute, when possible.

def add_weighted_spans(doc, vec, vectorized, target_expl):
    # type: (Any, Any, bool, TargetExplanation) -> None
    """
    Compute and set ``target_expl.weighted_spans`` attribute, when possible.
    """
    if vec is None or vectorized:
        return

    weighted_spans = get_weighted_spans(doc, vec, target_expl.feature_weights)
    if weighted_spans:
        target_expl.weighted_spans = weighted_spans