Skip to content

Commit

Permalink
Adds LabeledSentence to gensim.models.doc2vec (for backward compa…
Browse files Browse the repository at this point in the history
…tibility). Fix piskvorky#1886 (piskvorky#1891)
  • Loading branch information
manneshiva authored and sj29-innovate committed Feb 21, 2018
1 parent a2a5255 commit 855737a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gensim/models/doc2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
from gensim.models.base_any2vec import BaseWordEmbeddingsModel
from gensim.models.keyedvectors import Doc2VecKeyedVectors
from types import GeneratorType
from gensim.utils import deprecated

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -247,6 +248,12 @@ def __str__(self):
return '%s(%s, %s)' % (self.__class__.__name__, self.words, self.tags)


# for compatibility
@deprecated("Class will be removed in 4.0.0, use TaggedDocument instead")
class LabeledSentence(TaggedDocument):
pass


class Doctag(namedtuple('Doctag', 'offset, word_count, doc_count')):
"""A string document tag discovered during the initial vocabulary
scan. (The document-vector equivalent of a Vocab object.)
Expand Down

0 comments on commit 855737a

Please sign in to comment.