question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run the example provided.

See original GitHub issue
from 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ddangelovcommented, Oct 8, 2020

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 smaller min_count will be necessary.

0reactions
pidugusundeepcommented, Oct 8, 2020

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found