Figure from Reagan et al. 2016, the paper that showed that emotional arcs are not fantasies of Digital Humanists but existing structures in literary corpora.
One of my interests is applications of sentiment analysis to computational literary studies and digital humanities. To be short, at least for English we have a plenty of models. The problem is the trade-off between quality of sentiment output and interpretability: dictionary-based (when the algo just see in the list of positive and negative words and by some rule infers the text sentiment) and ML or neural network models (which can catch the sentiment very well if the corpus suffices for efficient training). First ones output with a huge error but very easy to interpret the process of how the sentiment is produced. Second ones may be very close to human annotation and get the context (it worths a lot, by the way), but even if you look how weighs make their journey through the layers of a neural network that won't explain you why "that son of a bitch is slow, but he shoots well from 300 yards" tends to to be positive even though he is not very good guy and slow.
The problem of neural network-based sentiment analysis in literary studies is that all BERT models were trained on financial news data (if the tool can predict how stock prices move, why not to invest into preparation of datasets), twitter posts, film reviews and reviews from marketplaces - data where sentiment can be extracted even from metadata. But they are rather far from literary texts with all respect to twitter (sorry, X) creators.
The rare example of a model tailored for literary texts is this one. But it contains just 13,864 sentences for train, test, and validation, collected from several datasets (great model anyway!).
This is my early experiment which surprisingly outperformed the conventional RoBERTa trained on twitter, which is very promising.
I am preparing the paper on this model and experiment so I will come back and tell more.
For now, you can try raw but still powerful model here.