We need to add version.diff.informal_words credibility signal so that consumers can know the difference in terms of informal words between the current revision as compared to its parent revision.
The implementation will require a small schema addition and making calls to utilities to populate the field values.
Steps:
- Step 1: First, need to update the version schema . [pls refer to documentation repo JSON schema/diff.json and delta.json]
{
"identifier": 1063955750,
.
.
"diff" : {
"informal_words" : {
"increase": 11,
"decrease": 2,
"sum" : 9,
"proportional_increase" : 2,
"proportional_decrease" : -2.3333
}
}
}- Step:2 Get the revision data with the two wikitexts (current rev and parent rev) in the articleupdate handler using revision utilitiy.
- Step:3 Get the word tokens in the two wikitexts using this utilitiy.
- Step:4 Get the informal words in the two wikitexts using this utilitiy.
- Step:5 Populate the required fields using utilities (increase, decrease, sum, proportional_increase, and proportional_decrease)
Flow:
