Created by: daming-lu
When we process sentiment analysis data, we provide a pair of words
and labels
. For example, ([9, 18, 1, 28, 761], 0)
. But when the review is empty, such as ([], 1)
, Paddle will crash by throwing an error like:
paddle.fluid.core.EnforceNotMet: enforce begin_idx < end_idx failed, 9069 >= 9069
We should add a try except
so that the program can continue running for good data.