-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat!: symbol coefficients and configurable scores per group #68
feat!: symbol coefficients and configurable scores per group #68
Conversation
/query @gentlementlegen |
|
|
What's newThe following changes in the configuration have been made:
QA runHere is a test with two different regex counters. |
@gentlementlegen Check this config and this CI run which outputs:
Is this error expected? |
? Object.values(formatting).reduce((acc, curr) => { | ||
let sum = new Decimal(0); | ||
for (const symbol of Object.keys(curr.symbols)) { | ||
sum = sum.add( | ||
new Decimal(curr.symbols[symbol].count) | ||
.mul(curr.symbols[symbol].multiplier) | ||
.mul(multiplierFactor.formattingMultiplier) | ||
.mul(curr.count) | ||
.mul(multiplierFactor.wordValue) | ||
), | ||
new Decimal(0) | ||
) | ||
.mul(curr.score) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my memory score was basically a reward for each tag, for example if there are 5 p tags and the score in the config is set to 5, then the reward is 25.
If I understand correctly now symbols/regex is counted inside the tag and multiplied by the multiplier for the symbol and then multiplied by formatting multiplier which is a multiplier that is same for all symbols and tags and then multiplied by score which is like a multiplier that is same for all symbols inside the tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@whilefoo yes that's pretty much what is happening there. Shall it be changed? If so I can take care of it in a separate PR.
Co-authored-by: whilefoo <[email protected]>
@gentlementlegen where can I find a working config setup? Is the readme one up to date? I'm getting typebox errors with it the same as rndquu had I think we should eslint.ignore
The union type is the roles but it seems like the defaults are also throwing looking at this log. I have tried two of the configs from this thread and the one from the readme. I have tried making small adjustments like indentation and using quotes for strings etc but no luck. The runs seems to be exiting without error but fails to load any modules. I'm not 100% on my triage but in my case all the user sees on the issue is
These are optional repo secrets right? and the only required ones are
I did get feedback when I had missing secrets which is good |
@Keyrxng There were major configuration changes after the last review requested changes, so here is one that should work for you: - uses:
- plugin: Meniole/conversation-rewards
with:
evmNetworkId: 100
evmPrivateEncrypted: "some-key"
incentives:
contentEvaluator: {}
userExtractor:
redeemTask: true
dataPurge: {}
formattingEvaluator:
multipliers:
- select: [ ISSUE_SPECIFICATION ]
multiplier: 1
rewards:
regex:
"\\b\\w+\\b": 0.1
"\\b\\W+\\b": 0.1
html:
br: 0
code: 1
p: 1
em: 0
img: 0
strong: 0
blockquote: 0
h1: 1
h2: 1
h3: 1
h4: 1
h5: 1
h6: 1
a: 1
li: 1
td: 1
hr: 0
- select: [ ISSUE_AUTHOR ]
multiplier: 1
rewards:
regex:
"\\b\\w+\\b": 0.2
- select: [ ISSUE_ASSIGNEE ]
multiplier: 0
rewards:
regex:
"\\b\\w+\\b": 0
- select: [ ISSUE_COLLABORATOR ]
multiplier: 1
rewards:
regex:
"\\b\\w+\\b": 0.1
- select: [ ISSUE_CONTRIBUTOR ]
multiplier: 0.25
rewards:
regex:
"\\b\\w+\\b": 0.1
- select: [ PULL_SPECIFICATION ]
multiplier: 0
rewards:
regex:
"\\b\\w+\\b": 0
- select: [ PULL_AUTHOR ]
multiplier: 2
rewards:
regex:
"\\b\\w+\\b": 0.2
- select: [ PULL_ASSIGNEE ]
multiplier: 1
rewards:
regex:
"\\b\\w+\\b": 0.1
- select: [ PULL_COLLABORATOR ]
multiplier: 1
rewards:
regex:
"\\b\\w+\\b": 0.1
- select: [ PULL_CONTRIBUTOR ]
multiplier: 0.25
rewards:
regex:
"\\b\\w+\\b": 0.1
permitGeneration: {}
githubComment:
post: true
debug: true The problem about the union type is actually that the error is within the |
const formattingTotal = formatting | ||
? Object.values(formatting).reduce((acc, curr) => { | ||
let sum = new Decimal(0); | ||
for (const symbol of Object.keys(curr.symbols)) { | ||
sum = sum.add( | ||
new Decimal(curr.symbols[symbol].count) | ||
.mul(curr.symbols[symbol].multiplier) | ||
.mul(multiplierFactor.formattingMultiplier) | ||
.mul(multiplierFactor.multiplier) | ||
.mul(curr.score) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you help me grasp how this calculation work?
At first for every tag (<a>
), the number of regex matches is counted (each regex has its own multiplier) and has a so called score which is defined in the config.
Then for the calculation, for every regex (symbol) the count is multiplied by the regex multiplier which makes sense, then that is multiplied by a "general" multiplier and multiplied by a score
which is a multiplier for the tag I assume.
I had to read the code a couple of times and it's hard to keep track of all different names for same things, like symbols = regex, score = multiplier for a tag and variables names are confusing such as wordCount
for regex count
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least in the config we renamed things accordingly. For example I'm pretty sure we renamed symbol
to regex
, so we should do the same in the code here.
Also score
should just sum per instance. For example if we want to award $1 for every paragraph, then score
for p
should be 1
.
score
is not supposed to be a multiplier.
However in the config I believe we also support a multiplier
property. This should be separate from score
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rename the variables to match the configuration. The score
concept does not exist (yet) in v2 and can be added in a separate PR. Only multipliers exist for now. Created #83
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also
score
should just sum per instance. For example if we want to award $1 for every paragraph, thenscore
forp
should be1
.
score
is not supposed to be a multiplier.
that was also my understanding but currently in the code it's a multiplier
I was reading the wrong step in the run but things appear to be the same for me as before. Using the config you gave me and little feedback on the issue. Am I the only one that can't run this? @whilefoo could you? Either I'm stupid af or it's going to be as tricky for partner's to get right as it appears to be for me lol. Would it be possible to use |
@Keyrxng can make it as another task because I think it is tricky to solve. The |
Very weird you'd expect that a fork of your branch, an exact config match and up to date kernel that it would work out-of-the-box. For sure another issue to address the typebox issue and improve feedback on the issue for scenarios like the one I've been experiencing. I also have a concern regarding env vars in this repo. It seems that Partner's that want to use this plugin need to use their org config to pass env vars as we don't want them to have to fork this repo. I think |
@Keyrxng please make a spec 😄 |
dae0b4d
into
ubiquity-os-marketplace:development
Resolves #62
Depends on #58, #55