chrsiebert / sentiment-roberta-large-english

Example code for sentiment analysis with a RoBERTa-based model.
4 stars 2 forks source link

NaN output? #1

Open spaidataiga opened 2 years ago

spaidataiga commented 2 years ago

Hi, I've been using this sentiment classifier via the HuggingFace pipeline to classify a large set of reddit comments as positive or negative sentiment. I've implemented it exactly as following this example., where a pandas Series of text is fed into the tokenizer which is then input into the Transformer. However, though I've tried varying the size of the input data-set, approximately the last half of the output is consistantly NaN. Is there a maximum size for an input for the Transformer, or do you have an idea as to what is causing this output?

chrsiebert commented 2 years ago

Hi Vara,

thanks for reaching out. You mean that some of the dataset ist classified as pos/neg, and then for the last rows it's NaN? Not sure why that might be, the model itself is not constrained. Maybe to little memory and then it gives NaN's when it runs out?

Best,

Christian

Christian Siebert @.*** +49 175 318 1660

On Sun, Nov 28, 2021 at 12:38 AM Vara Sera @.***> wrote:

Hi, I've been using this sentiment classifier via the HuggingFace pipeline to classify a large set of reddit comments as positive or negative sentiment. I've implemented it exactly as following this example. https://colab.research.google.com/github/chrsiebert/sentiment-roberta-large-english/blob/main/sentiment_roberta_prediction_example.ipynb#scrollTo=FhIONI7ett0q, where a pandas Series of text is fed into the tokenizer which is then input into the Transformer. However, though I've tried varying the size of the input data-set, approximately the last half of the output is consistantly NaN. Is there a maximum size for an input for the Transformer, or do you have an idea as to what is causing this output?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chrsiebert/sentiment-roberta-large-english/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANIFARJJGY4EZPRAUYHM4ZLUOFTYFANCNFSM5I4TOO7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.