def s2v_similarity(
        self, obj: Union[Token, Span], other: Union[Token, Span]
    ) -> float:
        """Extension attribute method. Estimate the similarity of two objects.

        obj (Token / Span): The object the attribute is called on.
        other (Token / Span): The object to compare it to.
        RETURNS (float): The similarity score.
        """
        if not isinstance(other, (Token, Span)):
            msg = f"Can only get similarity of Token or Span, not {type(other)}"
            raise ValueError(msg)
        return obj.doc._._s2v.similarity(self.s2v_key(obj), self.s2v_key(other))
Extension attribute method. Estimate the similarity of two objects.

        obj (Token / Span): The object the attribute is called on.
        other (Token / Span): The object to compare it to.
        RETURNS (float): The similarity score.
        
sense2vec/component.py