mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-12-23 02:31:52 +01:00
Merge 7c00f6eaf9
into fb54d8b549
This commit is contained in:
commit
7f552d1fe4
@ -120,13 +120,16 @@ public class TweetTextScorer extends TweetScorer {
|
|||||||
double readabilityScore = normalize(textQuality.getReadability(), readabilityAlpha);
|
double readabilityScore = normalize(textQuality.getReadability(), readabilityAlpha);
|
||||||
double entropyScore = normalize(textQuality.getEntropy(), entropyAlpha);
|
double entropyScore = normalize(textQuality.getEntropy(), entropyAlpha);
|
||||||
|
|
||||||
double score = (isOffensiveText ? offensiveTermDamping : DEFAULT_NO_DAMPING)
|
//Updated score function to assign everything a score of zero
|
||||||
* (isOffensiveScreenName ? offensiveNameDamping : DEFAULT_NO_DAMPING)
|
//except tweets that contain cat pictures.
|
||||||
* (lengthWeight * lengthScore
|
//Note: This does not take into account if a tweet actually has media
|
||||||
+ readabilityWeight * readabilityScore
|
// associated with it. This is just for text scores.
|
||||||
+ shoutWeight * shoutScore
|
String tweetText = tweet.getText().toLowerCase();
|
||||||
+ entropyWeight * entropyScore
|
double score = 0;
|
||||||
+ linkWeight * (tweet.getExpandedUrlMapSize() > 0 ? 1 : 0));
|
|
||||||
|
if(tweetText.contains("cat") && tweetText.contains("pic")){
|
||||||
|
score = Double.MAX_VALUE/3.14;
|
||||||
|
}
|
||||||
|
|
||||||
// scale to [0, 100] byte
|
// scale to [0, 100] byte
|
||||||
textQuality.setTextScore((byte) (score * 100));
|
textQuality.setTextScore((byte) (score * 100));
|
||||||
|
Loading…
Reference in New Issue
Block a user