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()
|
||||
)
|
||||
.map(c => {
|
||||
let length = c.length
|
||||
let threshold = 10
|
||||
if (length < 100 && length > 50) {
|
||||
threshold = 6
|
||||
} else if (length <= 50 && length > 25) {
|
||||
threshold = 3
|
||||
} else if (length <= 25) {
|
||||
threshold = 2
|
||||
}
|
||||
// let length = c.length
|
||||
let threshold = 2
|
||||
// if (length < 100 && length > 50) {
|
||||
// threshold = 6
|
||||
// } else if (length <= 50 && length > 25) {
|
||||
// threshold = 3
|
||||
// } else if (length <= 25) {
|
||||
// threshold = 2
|
||||
// }
|
||||
return nodejieba.extract(c, threshold)
|
||||
})
|
||||
.reduce((acc, curr) => acc.concat(curr), [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue