mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: 降低词云阈值
This commit is contained in:
parent
a45be2e211
commit
56a893734c
1 changed files with 9 additions and 9 deletions
|
|
@ -95,15 +95,15 @@ export class Tokenizer {
|
||||||
.join('').trim()
|
.join('').trim()
|
||||||
)
|
)
|
||||||
.map(c => {
|
.map(c => {
|
||||||
let length = c.length
|
// let length = c.length
|
||||||
let threshold = 10
|
let threshold = 2
|
||||||
if (length < 100 && length > 50) {
|
// if (length < 100 && length > 50) {
|
||||||
threshold = 6
|
// threshold = 6
|
||||||
} else if (length <= 50 && length > 25) {
|
// } else if (length <= 50 && length > 25) {
|
||||||
threshold = 3
|
// threshold = 3
|
||||||
} else if (length <= 25) {
|
// } else if (length <= 25) {
|
||||||
threshold = 2
|
// threshold = 2
|
||||||
}
|
// }
|
||||||
return nodejieba.extract(c, threshold)
|
return nodejieba.extract(c, threshold)
|
||||||
})
|
})
|
||||||
.reduce((acc, curr) => acc.concat(curr), [])
|
.reduce((acc, curr) => acc.concat(curr), [])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue