Skip to content

Support different scoring algorithms #8

@peterwoodworth

Description

@peterwoodworth

Description

Currently, the scoring algorithm gives the first word in the title a score of 1, which decreases logarithmically according to the formula 2/(1+n)

The body scores each word the same, but this score is configurable

Use Case

Logarithmic scoring for titles might not be ideal for everyone - especially users who have the action configured such that ties will frequently (intentionally) happen.

I'm not sure if anyone would want logarithmic scoring for the body - but that could be supported pretty easily

Any proposals for alternate methods of scoring would be much appreciated

Proposed Solution

This is where area scoring is done:

const weightedTitle: (n: number) => number = (n: number) => {
return (2/(1+n));
}
// For each word in the title, check if it matches any keywords. If it does, add decreasing score based on inverse function to the area keyword is in.
if(this.titleIssueWords) {
this.titleIssueWords.forEach(content => {
potentialAreas = this.scoreArea(content, potentialAreas, titleValue);
++x;
titleValue = weightedTitle(x);
});
}
// Add static value to area keyword is in if keyword is found in body
if(this.bodyIssueWords) {
this.bodyIssueWords.forEach(content => {
potentialAreas = this.scoreArea(content, potentialAreas, this.bodyValue);
});
}

I can think of a few ways to potentially do this, will comment later

Other Info

No response

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions