diff --git a/src/main/kotlin/ltd/guimc/lgzbot/PluginMain.kt b/src/main/kotlin/ltd/guimc/lgzbot/PluginMain.kt index 56666b4..043a954 100644 --- a/src/main/kotlin/ltd/guimc/lgzbot/PluginMain.kt +++ b/src/main/kotlin/ltd/guimc/lgzbot/PluginMain.kt @@ -151,6 +151,7 @@ object PluginMain : KotlinPlugin( webHookService.start() logger.info("正在初始化 LL4J") LL4JUtils.init() + thread { LL4JUtils.downloadModel() }.start() logger.info("$name v$version 加载好了喵") } diff --git a/src/main/kotlin/ltd/guimc/lgzbot/utils/LL4JUtils.kt b/src/main/kotlin/ltd/guimc/lgzbot/utils/LL4JUtils.kt index 24fa2a2..235c293 100644 --- a/src/main/kotlin/ltd/guimc/lgzbot/utils/LL4JUtils.kt +++ b/src/main/kotlin/ltd/guimc/lgzbot/utils/LL4JUtils.kt @@ -22,15 +22,20 @@ object LL4JUtils { } fun predict(string: String): Boolean = - model.predictDebug(tokenizer.tokenize(0, string.replace("\n", "")).values).first == 1 + model.predictDebug( + tokenizer.tokenize( + 0, + string.replace("\n", "").replace("live.bilibili.com", "") + ).values + ).first == 1 fun predictDebug(string: String): Pair = - model.predictDebug(tokenizer.tokenize(0, string.replace("\n", "")).values) + model.predictDebug(tokenizer.tokenize(0, string.replace("\n", "").replace("live.bilibili.com", "")).values) fun predictAllResult(string: String): DoubleArray = model.predictAllResult( tokenizer.tokenize( - 0, sbc2dbcCase(string.replace("\n", "")) + 0, sbc2dbcCase(string.replace("\n", "").replace("live.bilibili.com", "")) .lowercase() .removeInterference() .removeNonVisible()