Skip to content

Commit

Permalink
chore: set back priority multiplier to the result
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Dec 18, 2024
1 parent 55776c4 commit 5344b3b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/parser/content-evaluator-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class ContentEvaluatorModule extends BaseModule {
}

for (const currentComment of commentsWithScore) {
let currentRelevance = 1; // For comments not in fixed relevance types and missed by OpenAI evaluation
let currentRelevance = 0.83; // For comments not in fixed relevance types and missed by OpenAI evaluation
if (this._fixedRelevances[currentComment.type]) {
currentRelevance = this._fixedRelevances[currentComment.type];
} else if (!isNaN(relevancesByAi[currentComment.id])) {
Expand All @@ -113,12 +113,13 @@ export class ContentEvaluatorModule extends BaseModule {

// eslint-disable-next-line sonarjs/prefer-nullish-coalescing
const currentReward = new Decimal(currentComment.score?.reward || 0);
const priority = currentComment.score?.priority ?? 1;

currentComment.score = {
...(currentComment.score || { multiplier: 0 }),
relevance: new Decimal(currentRelevance).toNumber(),
priority: currentComment.score?.priority ?? 1,
reward: currentReward.mul(currentRelevance).toNumber(),
priority: priority,
reward: currentReward.mul(currentRelevance).mul(priority).toDecimalPlaces(3).toNumber(),
};
}

Expand Down

0 comments on commit 5344b3b

Please sign in to comment.