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
Describe the bug
Sentiments analysis on an empty input raises the following exception: IndexError: tuple index out of range.
I didn't see this error mentionned in current issues.
2021-07-20 14:21:11 INFO: Loading these models for language: en (English):
========================
| Processor | Package |
------------------------
| tokenize | combined |
| sentiment | sstplus |
========================
2021-07-20 14:21:11 INFO: Use device: gpu
2021-07-20 14:21:11 INFO: Loading: tokenize
2021-07-20 14:21:18 INFO: Loading: sentiment
2021-07-20 14:21:18 INFO: Done loading processors!
Traceback (most recent call last):
File "test.py", line 4, in <module>
doc = nlp('')
File "/home/amillo/.local/lib/python3.8/site-packages/stanza/pipeline/core.py", line 253, in __call__
doc = self.process(doc)
File "/home/amillo/.local/lib/python3.8/site-packages/stanza/pipeline/core.py", line 247, in process
doc = process(doc)
File "/home/amillo/.local/lib/python3.8/site-packages/stanza/pipeline/sentiment_processor.py", line 53, in process
labels = cnn_classifier.label_text(self._model, text, batch_size=self._batch_size)
File "/home/amillo/.local/lib/python3.8/site-packages/stanza/models/classifiers/cnn_classifier.py", line 449, in label_text
text, orig_idx = sort_with_indices(text, key=len, reverse=True)
File "/home/amillo/.local/lib/python3.8/site-packages/stanza/models/common/utils.py", line 223, in sort_with_indices
return result[1], result[0]
IndexError: tuple index out of range
To Reproduce
To get the error, you can try this basic snippet of code, which is a slightly modified example from the official documentation.
However, this example assumes that you've already downloaded the corresponding model.
Expected behavior
The expected result would be to get back a working document, without any exception.
The expected output (from my limited experience) should be:
Environment (please complete the following information):
OS: Ubuntu (WSL 2 - 21H2 - Build 22000.71)
Python version: Python 3.8.10
Stanza version: 1.2.2
Additional context
I don't know if this error is happening with older versions of Stanza as well, since I didn't try to feed any pipeline with an empty input before. Nevertheless, I've never met this error with Stanza 1.2.0.
The text was updated successfully, but these errors were encountered:
Describe the bug
Sentiments analysis on an empty input raises the following exception:
IndexError: tuple index out of range
.I didn't see this error mentionned in current issues.
The pipeline used to obtain this result:
The actual result:
To Reproduce
To get the error, you can try this basic snippet of code, which is a slightly modified example from the official documentation.
However, this example assumes that you've already downloaded the corresponding model.
Expected behavior
The expected result would be to get back a working document, without any exception.
The expected output (from my limited experience) should be:
Environment (please complete the following information):
Additional context
I don't know if this error is happening with older versions of Stanza as well, since I didn't try to feed any pipeline with an empty input before. Nevertheless, I've never met this error with Stanza 1.2.0.
The text was updated successfully, but these errors were encountered: