Unable to run the example provided.
See original GitHub issuefrom top2vec import Top2Vec
from sklearn.datasets import fetch_20newsgroups
newsgroups = fetch_20newsgroups(subset='all', remove=('headers', 'footers', 'quotes'))
model = Top2Vec(documents=newsgroups.data, speed="learn", workers=8)
Error:
Traceback (most recent call last):
File "checkThis.py", line 13, in <module>
model = Top2Vec(documents=allSents, speed="learn", workers=8)
File "/workspace/Top2Vec/top2vec/Top2Vec.py", line 234, in __init__
self._create_topic_vectors(cluster.labels_)
File "/workspace/Top2Vec/top2vec/Top2Vec.py", line 260, in _create_topic_vectors
self.topic_vectors = np.vstack([self.model.docvecs.vectors_docs[np.where(cluster_labels == label)[0]]
File "<__array_function__ internals>", line 5, in vstack
File "/workspace/.pip-modules/lib/python3.8/site-packages/numpy/core/shape_base.py", line 283, in vstack
return _nx.concatenate(arrs, 0)
File "<__array_function__ internals>", line 5, in concatenate
ValueError: need at least one array to concatenate
My NumPy version : ‘1.19.0’
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
The AGP_Pruner example provided can not run successfully ...
The AGP_Pruner example provided can not run successfully, An error occurred: TypeError: unsupported operand type (s) for *: 'Tensor' and 'dict' #2035.
Read more >unable to run the sample example - Oracle Communities
i am trying to run the sample example given on otn for jdeveloper. when i try running it i get the following error:...
Read more >Not able to run basic example of pycparser - Stack Overflow
I am trying to start with pycparser and was trying to run the examples given on the github repo. I only changed the...
Read more >unable to run the l3VPN services example on the NSO user ...
Hi,. I don't seem to be able to run one of the examples provided on the user guide because of the following error...
Read more >How to troubleshoot Windows Installer errors - Microsoft Support
Could not start the Windows Installer service on Local Computer. Error 5: Access is denied. Resolution. To fix this problem automatically, run the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am not sure what the exact number is but 1000+ is usually good. I will look at setting a threshold in the future. Also if you are using fewer documents, try setting
min_count
to 1. That could also help.min_count
ignores all words with total frequency lower than this. For smaller corpora a smallermin_count
will be necessary.That worked, when I used
newsgroups.data
but when I use plain sentences of length 300(list) it again shows me the error curious to know if there is any minimum requirement of sentences that should be used for documents?