Sense2VecEncoder

embetter.text.Sense2VecEncoder

Create a Sense2Vec encoder, meant to help when encoding phrases as opposed to sentences.

Parameters

Name Type Description Default
path path to downloaded model required

transform(self, X, y=None)

Show source code in text/_s2v.py
21
22
23
    def transform(self, X, y=None):
        """Transforms the phrase text into a numeric representation."""
        return np.array([self.s2v[x] for x in X])

Transforms the phrase text into a numeric representation.