Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support different scoring algorithms #8

Open
2 tasks
peterwoodworth opened this issue Nov 18, 2021 · 0 comments
Open
2 tasks

Support different scoring algorithms #8

peterwoodworth opened this issue Nov 18, 2021 · 0 comments

Comments

@peterwoodworth
Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant