'Given a document not in the model, returns a vector in LSA concept space.
This happes automatically in Model.cosine_similarity(),
but it must be done explicitly for Classifier.classify() input.'

def transform(self, document):

    if (document.id in self.u):
        return self.u[document.id]
    if (document.id in _lsa_transform_cache):
        return _lsa_transform_cache[document.id]
    import numpy
    v = self.model.vector(document)
    v = [v[self._terms[i]] for i in range(len(v))]
    v = numpy.dot(numpy.dot(numpy.linalg.inv(numpy.diag(self.sigma)), self.vt), v)
    v = _lsa_transform_cache[document.id] = Vector(enumerate(v))
    return v
