Score Processors
NumberNormalizer(scale, decimal_rounding=None)
Bases: ScoreProcessor
Class that normalizes numeric scores to a scale in the range \([-1.0, 1.0]\)
PARAMETER | DESCRIPTION |
---|---|
scale |
Tuple where the first value is the minimum of the actual scale, second value is the maximum of the
actual scale (e.g. |
decimal_rounding |
If set, the normalized score will be rounded to the chosen decimal digit
TYPE:
|
Source code in clayrs/content_analyzer/ratings_manager/score_processor.py
48 49 50 51 52 53 54 55 56 |
|
fit(score_data)
Method which will normalize the given score
PARAMETER | DESCRIPTION |
---|---|
score_data |
score that will be normalized
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
score normalized in the interval \([-1, 1]\) |
Source code in clayrs/content_analyzer/ratings_manager/score_processor.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
TextBlobSentimentAnalysis(decimal_rounding=None)
Bases: SentimentAnalysis
Class that compute sentiment polarity on a textual field using TextBlob library.
The given score will be in the \([-1.0, 1.0]\) range
Source code in clayrs/content_analyzer/ratings_manager/sentiment_analysis.py
12 13 |
|
fit(score_data)
This method calculates the sentiment polarity score on textual reviews
PARAMETER | DESCRIPTION |
---|---|
score_data |
text for which sentiment polarity must be computed and considered as score
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
The sentiment polarity of the textual data in range \([-1.0, 1.0]\) |
Source code in clayrs/content_analyzer/ratings_manager/sentiment_analysis.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|