Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update news_preprocess.py #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Sanky18
Copy link

@Sanky18 Sanky18 commented Jan 19, 2024

Instead of using np.concatenate, try using a list comprehension to flatten your nested list. Ensure that none of the sublists in your words list are empty. An empty sublist can also cause issues when creating a NumPy array.

Instead of using np.concatenate, try using a list comprehension to flatten your nested list. Ensure that none of the sublists in your words list are empty. An empty sublist can also cause issues when creating a NumPy array.
@chuchunchi
Copy link

Hi @Sanky18,
I try to re-run this repo but get the error and fixed it the same way as your PR, however, please let me know if you've also encounter the following error when running train.py after preprocess the news.tsv with such method. Thanks.

Traceback (most recent call last):
  File "/Users/chuchun/Documents/NRMS_new-for-MIND/src/main.py", line 228, in <module>
    training_data = np.array(training_data)
                    ^^^^^^^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (375398, 4) + inhomogeneous part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants