class SENTResult(BaseModel):
class Sentiment(BaseModel):
label: str
score: float
sentiments: List[Sentiment]
This setup was made to allow processing of longer than model's context input strings. Sentiment score should be considered as a single value, not a list of values. With this in mind required modification is to implement an average of scores in the list as:
sentiments = sum(sentiments)/len(sentiments)
class SENTResult(BaseModel):
class Sentiment(BaseModel):
label: str
score: float
sentiment: List[Sentiment]
SENTResult
currently returns the following:This setup was made to allow processing of longer than model's context input strings. Sentiment score should be considered as a single value, not a list of values. With this in mind required modification is to implement an average of scores in the list as: