I'm trying thhe Keras example from spacy documentation, but instead of suming the sentiment score in the Doc like that
for sent, label in zip(sentences, ys):
sent.doc.sentiment += label - 0.5
I would like to keep the score on the sentence level like that
for sent, label in zip(sentences, ys):
sent.sentiment = float(label)
This code give me that error
AttributeError: attribute 'sentiment' of 'spacy.tokens.span.Span' objects is not writable
Is there a setter to call instead? I tried set_sentiment without success.
Am I missing something? Is it a bug?