Sentiment Analysis is the process of analyzing online pieces of writing to determine the emotional tone they carry, whether they’re positive, negative, or neutral.
A sentiment analysis model can be made to output a simple positive/negative, or there can be a positive/neutral/negative output, or there can also be a 5 stage output represented by 0, 1, 2, 3, 4 where 0 is the most negative and 5 is the most positive.
The table below shows the type of loss which can be used depending on the type of model to be designed:

As shown, if the output is a simple positive/negative a Binary Crossentropy loss can be used. If the output is more than 2 classes, a Categorical Crossentropy can be used.