Skip to content

Commit

Permalink
update: quality calc params
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Apr 30, 2024
1 parent ff4aee5 commit b02fbf4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 3.5.1

- 优化:视频质量计算参数
- 修复:修复typo,优化代码

## 3.5.0
Expand Down
18 changes: 13 additions & 5 deletions src/filters/videoFilter/filters/subfilters/quality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ class QualityFilter implements IVideoSubFilter {
this.threshold = threshold
}

// 根据coinLikeRatio计算视频质量, 参数源于爬虫数据拟合
/*
根据coinLikeRatio计算视频质量
对爬虫数据中投币点赞比在热门视频中所在排名进行拟合(百分制,4PL Formula)
保持Quality在5%~80%时的高拟合度
热门(质量要求适中):f(x) = (-9.881-168.6)/(1+(x/0.3829)^0.6463)+168.6
排行榜(较低):h(x) = (-14.82-115.9)/(1+(x/0.05327)^0.6639)+115.9
每周必看(严格):p(x) = (1.534-173.4)/(1+(x/0.7463)^1.401)+173.4
*/
calcQuality = (ratio: number): number => {
const A = -1.201e1
const B = 6.861e-1
const C = 7.369e-2
const D = 1.192e2
const A = -9.881
const B = 6.463e-1
const C = 3.829e-1
const D = 1.686e2
const ans = (A - D) / (1 + Math.pow(ratio / C, B)) + D
return ans > 0 ? ans : 0
}
Expand Down
4 changes: 2 additions & 2 deletions src/filters/videoFilter/pages/popular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ if (isPagePopular()) {
}),
new NumberItem({
itemID: popularQualityAction.valueKey,
description: '设定 劣质视频过滤百分比',
defaultValue: 20,
description: '劣质视频过滤百分比 (0~80%)',
defaultValue: 25,
minValue: 0,
maxValue: 80,
disableValue: 0,
Expand Down

0 comments on commit b02fbf4

Please sign in to comment.