relevanceai.operations.text.sentiment.sentiments#

Add Sentiment to your dataset

Module Contents#

class relevanceai.operations.text.sentiment.sentiments.SentimentOps(model_name: str = 'cardiffnlp/twitter-roberta-base-sentiment')#

Base class for operations

preprocess(self, text: str)#
property classifier(self)#
property label_mapping(self)#
analyze_sentiment(self, text, highlight: bool = False, positive_sentiment_name: str = 'positive', max_number_of_shap_documents: Optional[int] = None, min_abs_score: float = 0.1)#
property explainer(self)#
get_shap_values(self, text: str, sentiment_ind: int = 2, max_number_of_shap_documents: Optional[int] = None, min_abs_score: float = 0.1)#

Get SHAP values