fajri91 / sum_liputan6

The first large-scale summarization corpus for the Indonesian language. AACL 2020.
35 stars 8 forks source link

ValueError: setting an array element with a sequence. @ create extractive label #5

Open adibenc opened 1 year ago

adibenc commented 1 year ago

Error

I had errors when try to run 2_create_extractive_label.py. I don't know if this is normal or not. The source of error from the thrown err below is this: article = np.array(data['clean_article'][:MAX_SENTENCE]). I think each sentence has a different length and it tries to make square np.array, so the error is thrown. What should be the solution?

Process Process-1:
Traceback (most recent call last):
  File "/home/zam/miniconda3/envs/tf/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/home/zam/miniconda3/envs/tf/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/media/data1/_pj/sum_liputan6/2_create_extractive_label.py", line 105, in run_thread
    data = find_label(f)
  File "/media/data1/_pj/sum_liputan6/2_create_extractive_label.py", line 58, in find_label
    article = np.array(data['clean_article'][:MAX_SENTENCE])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (17,) + inhomogeneous part.
Process Process-2:
Traceback (most recent call last):
  File "/home/zam/miniconda3/envs/tf/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/home/zam/miniconda3/envs/tf/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/media/data1/_pj/sum_liputan6/2_create_extractive_label.py", line 105, in run_thread
    data = find_label(f)
  File "/media/data1/_pj/sum_liputan6/2_create_extractive_label.py", line 58, in find_label
    article = np.array(data['clean_article'][:MAX_SENTENCE])
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (7,) + inhomogeneous part.
Process Process-3:
...