You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/pandas/core/indexes/base.py:3081, in Index.get_loc(self, key, method, tolerance)
3080 try:
-> 3081 return self._engine.get_loc(casted_key)
3082 except KeyError as err:
File pandas/_libs/index.pyx:70, in pandas._libs.index.IndexEngine.get_loc()
File pandas/_libs/index.pyx:101, in pandas._libs.index.IndexEngine.get_loc()
File pandas/_libs/hashtable_class_helper.pxi:1625, in pandas._libs.hashtable.Int64HashTable.get_item()
File pandas/_libs/hashtable_class_helper.pxi:1632, in pandas._libs.hashtable.Int64HashTable.get_item()
KeyError: 21021
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
Cell In[10], line 2
1 ##reduce the number of topics generated from Top2Vec if the machine autormatically generates to many topcis##
----> 2 reduced_topic=model.hierarchical_topic_reduction(num_topics=30)
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/top2vec/Top2Vec.py:1882, in Top2Vec.hierarchical_topic_reduction(self, num_topics)
1878 doc_top = self._calculate_documents_topic(topic_vectors=top_vecs,
1879 document_vectors=self.document_vectors,
1880 dist=False)
1881 topic_sizes = pd.Series(doc_top).value_counts()
-> 1882 top_sizes = [topic_sizes[i] for i in range(0, len(topic_sizes))]
1884 else:
1885 smallest_size = top_sizes.pop(smallest)
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/top2vec/Top2Vec.py:1882, in (.0)
1878 doc_top = self._calculate_documents_topic(topic_vectors=top_vecs,
1879 document_vectors=self.document_vectors,
1880 dist=False)
1881 topic_sizes = pd.Series(doc_top).value_counts()
-> 1882 top_sizes = [topic_sizes[i] for i in range(0, len(topic_sizes))]
1884 else:
1885 smallest_size = top_sizes.pop(smallest)
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/pandas/core/series.py:853, in Series.getitem(self, key)
850 return self._values[key]
852 elif key_is_scalar:
--> 853 return self._get_value(key)
855 if is_hashable(key):
856 # Otherwise index.get_value will raise InvalidIndexError
857 try:
858 # For labels that don't resolve as scalars like tuples and frozensets
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/pandas/core/series.py:961, in Series._get_value(self, label, takeable)
958 return self._values[label]
960 # Similar to Index.get_value, but we do not fall back to positional
--> 961 loc = self.index.get_loc(label)
962 return self.index._get_values_for_loc(self, loc, label)
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/pandas/core/indexes/base.py:3083, in Index.get_loc(self, key, method, tolerance)
3081 return self._engine.get_loc(casted_key)
3082 except KeyError as err:
-> 3083 raise KeyError(key) from err
3085 if tolerance is not None:
3086 tolerance = self._convert_tolerance(tolerance, np.asarray(key))
The text was updated successfully, but these errors were encountered:
Hi,
I had this error message when trying to reduce my topic size. Any suggestion on that? Thanks!
reduced_topic=model.hierarchical_topic_reduction(num_topics=30),
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/pandas/core/indexes/base.py:3081, in Index.get_loc(self, key, method, tolerance)
3080 try:
-> 3081 return self._engine.get_loc(casted_key)
3082 except KeyError as err:
File pandas/_libs/index.pyx:70, in pandas._libs.index.IndexEngine.get_loc()
File pandas/_libs/index.pyx:101, in pandas._libs.index.IndexEngine.get_loc()
File pandas/_libs/hashtable_class_helper.pxi:1625, in pandas._libs.hashtable.Int64HashTable.get_item()
File pandas/_libs/hashtable_class_helper.pxi:1632, in pandas._libs.hashtable.Int64HashTable.get_item()
KeyError: 21021
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
Cell In[10], line 2
1 ##reduce the number of topics generated from Top2Vec if the machine autormatically generates to many topcis##
----> 2 reduced_topic=model.hierarchical_topic_reduction(num_topics=30)
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/top2vec/Top2Vec.py:1882, in Top2Vec.hierarchical_topic_reduction(self, num_topics)
1878 doc_top = self._calculate_documents_topic(topic_vectors=top_vecs,
1879 document_vectors=self.document_vectors,
1880 dist=False)
1881 topic_sizes = pd.Series(doc_top).value_counts()
-> 1882 top_sizes = [topic_sizes[i] for i in range(0, len(topic_sizes))]
1884 else:
1885 smallest_size = top_sizes.pop(smallest)
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/top2vec/Top2Vec.py:1882, in (.0)
1878 doc_top = self._calculate_documents_topic(topic_vectors=top_vecs,
1879 document_vectors=self.document_vectors,
1880 dist=False)
1881 topic_sizes = pd.Series(doc_top).value_counts()
-> 1882 top_sizes = [topic_sizes[i] for i in range(0, len(topic_sizes))]
1884 else:
1885 smallest_size = top_sizes.pop(smallest)
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/pandas/core/series.py:853, in Series.getitem(self, key)
850 return self._values[key]
852 elif key_is_scalar:
--> 853 return self._get_value(key)
855 if is_hashable(key):
856 # Otherwise index.get_value will raise InvalidIndexError
857 try:
858 # For labels that don't resolve as scalars like tuples and frozensets
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/pandas/core/series.py:961, in Series._get_value(self, label, takeable)
958 return self._values[label]
960 # Similar to Index.get_value, but we do not fall back to positional
--> 961 loc = self.index.get_loc(label)
962 return self.index._get_values_for_loc(self, loc, label)
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/pandas/core/indexes/base.py:3083, in Index.get_loc(self, key, method, tolerance)
3081 return self._engine.get_loc(casted_key)
3082 except KeyError as err:
-> 3083 raise KeyError(key) from err
3085 if tolerance is not None:
3086 tolerance = self._convert_tolerance(tolerance, np.asarray(key))
The text was updated successfully, but these errors were encountered: