Class SentimentAnalyzer
java.lang.Object
org.episteme.social.linguistics.SentimentAnalyzer
Analytical tool for sentiment analysis and emotional polarity detection in text.
It identifies positive, negative, and neutral tones using a lexicon-based
approach with support for negations and intensifiers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumQualitative classification of text sentiment.static final recordResult of a sentiment analysis operation. -
Method Summary
Modifier and TypeMethodDescriptionPerforms sentiment analysis on a raw text string.static Map<String, SentimentAnalyzer.SentimentResult> analyzeWithAspects(String text, List<String> aspects) Performs aspect-based sentiment analysis by targeting specific keywords.static RealsentimentDifference(String text1, String text2) Calculates the numerical sentiment difference between two texts.
-
Method Details
-
analyze
Performs sentiment analysis on a raw text string.- Parameters:
text- the input text to analyze- Returns:
- a SentimentResult containing the polarity score and classification
-
analyzeWithAspects
public static Map<String, SentimentAnalyzer.SentimentResult> analyzeWithAspects(String text, List<String> aspects) Performs aspect-based sentiment analysis by targeting specific keywords.- Parameters:
text- full text inputaspects- list of keywords (aspects) to analyze separately- Returns:
- map of aspects to their corresponding SentimentResult
-
sentimentDifference
-