ubiquibot / conversation-rewards

0 stars 17 forks source link

Rename variables to match the configuration and introduce `elementScore` concept #92

Open 0x4007 opened 3 weeks ago

0x4007 commented 3 weeks ago

I was reviewing this action run and its a lot more clear to me when looking at the clean JSON logs exactly whats going on here. I realized that the scoring is implemented incorrectly. The primary crediting strategy is supposed to be based on the amount of elements. The word counter is a separate scoring mechanism. This was added as an after thought in version one, but it seems that you prioritized word count over element count.

The problem is that the original emphasis on element count allows us to easily target and credit special and useful elements such as <a>, <img>, and <code>. Helpful comments generally have links, images and code samples.

Now you are keeping track of word count PER element which is more complex than it needs to be. Remember, the word count scoring strategy was added as an after thought for version one. Version one simply counts all the words in the comment (but also ignores words in specific elements, like code.) at the end of all the complex calculations.

Aside from the ignore capability, it doesn't care which element contains the words.

{
  "id": 2014495969,
  "content": "Wouldn't solve scenarios requiring keys or credentials",
  "url": "https://github.com/ubiquity/cloudflare-deploy-action/issues/6#issuecomment-2014495969",
  "type": "ISSUE_ASSIGNEE",
  "score": {
    "formatting": {
      "content": {
        "p": {
          "count": 7, // should be changed to `wordCount` and you should correctly count the amount of `p` tags to be `elementCount`
          "score": 1
        }
      },
      "wordValue": 0,
      "formattingMultiplier": 0
    },
    "reward": 0,
    "relevance": 0.3
  }
}

Source

0x4007 commented 3 weeks ago

Originally created at https://github.com/ubiquibot/conversation-rewards/issues/83

0x4007 commented 3 weeks ago

Hope that you can prioritize this so that I can start fine tuning the incentives!