Skip to content

Commit

Permalink
Merge pull request #495 from bettersg/develop
Browse files Browse the repository at this point in the history
3.3.7
  • Loading branch information
sarge1989 authored Oct 26, 2024
2 parents 6eb2daf + 3d16315 commit 082e8de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions functions/src/definitions/common/counters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ const getVoteCounts = async function (messageRef: DocumentReference) {
const factCheckerCount = totalVoteRequestsCount - passCount //don't count "error" votes in number of fact checkers, as this will slow the replies unnecessarily.
const validResponsesCount = responsesCount - passCount //can remove in future and replace with nonErrorCount
const susCount = scamCount + illicitCount
const noClaimCount = irrelevantCount + legitimateCount
const truthScore = computeTruthScore(infoCount, voteTotal)
let harmfulCount = scamCount + illicitCount
let harmlessCount = legitimateCount + spamCount + irrelevantCount
let harmlessCount = legitimateCount + spamCount
if (truthScore !== null) {
if (truthScore < (thresholds.falseUpperBound || 2.5)) {
harmfulCount += infoCount
} else if (truthScore <= (thresholds.misleadingUpperBound || 4)) {
} else if (truthScore <= (thresholds.misleadingUpperBound || 3.75)) {
//pass
} else {
harmlessCount += infoCount
Expand All @@ -132,6 +133,7 @@ const getVoteCounts = async function (messageRef: DocumentReference) {
voteTotal,
validResponsesCount,
susCount,
noClaimCount,
truthScore,
harmfulCount,
harmlessCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"endVoteUnsureAbsolute": 16,
"startVote": 1,
"isSpam": 0.5,
"isNoClaim": 0.5,
"isLegitimate": 0.5,
"isInfo": 0.5,
"isIrrelevant": 0.5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const onVoteRequestUpdateV2 = onDocumentUpdated(
voteTotal,
validResponsesCount,
susCount,
noClaimCount,
factCheckerCount,
truthScore,
harmfulCount,
Expand All @@ -112,10 +113,10 @@ const onVoteRequestUpdateV2 = onDocumentUpdated(
const isInfo = infoCount > thresholds.isInfo * validResponsesCount
const isSatire = satireCount > thresholds.isSatire * validResponsesCount
const isSpam = spamCount > thresholds.isSpam * validResponsesCount
const isLegitimate =
legitimateCount > thresholds.isLegitimate * validResponsesCount
const isIrrelevant =
irrelevantCount > thresholds.isIrrelevant * validResponsesCount
const isNoClaim =
noClaimCount > thresholds.isNoClaim * validResponsesCount
const isLegitimate = isNoClaim && legitimateCount > irrelevantCount
const isIrrelevant = isNoClaim && !isLegitimate
const isHarmless =
harmlessCount > thresholds.isHarmless * validResponsesCount
const isHarmful =
Expand Down

0 comments on commit 082e8de

Please sign in to comment.