Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Chartrand committed Mar 17, 2021
1 parent 1c1d6df commit 05b12b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clctm.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def do_multiple(iids):
self.unifs = set(self.input_ids)

if vectorize:
self.vectorize(range(old_n_docs, self.n_docs))
self._vectorize_docs(range(old_n_docs, self.n_docs))

def _get_indices(self, doc_idx):
if isinstance(doc_idx, int):
Expand Down Expand Up @@ -187,6 +187,9 @@ def _vectorize_docs(self, start=0):
self._get_single_doc(d) for d in tqdm.trange(start, self.n_docs, desc="Infering token vectors")
])

def vectorize_new(self):
self._vectorize_docs(len(self.token_vectors))

def get_doc(self, doc_idx):
"""
Returns the vector for document at position <doc_idx>. If `doc_idx` is a list, tuple or
Expand Down

0 comments on commit 05b12b8

Please sign in to comment.