From 568b5eee6625d8c7ee03979c5c08be7a263c6ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Mon, 22 Jul 2024 20:36:47 +0800 Subject: [PATCH] rank --- docs/index.html | 3 -- docs/main.js | 63 ++++++++++++++++++++++++++++++++++++++ docs/test.bat | 1 + docs/zh/guochandamoxing.md | 9 +++++- 4 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 docs/test.bat diff --git a/docs/index.html b/docs/index.html index 34d10bf6..9e93a1ee 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,9 +10,6 @@ - - - diff --git a/docs/main.js b/docs/main.js index 0164a09d..bf12eae4 100644 --- a/docs/main.js +++ b/docs/main.js @@ -65,6 +65,69 @@ window.$docsify = { }); }) }, + function (hook, vm) { + hook.doneEach(() => { + var toupiao = document.getElementById('toupiao') + if (toupiao == null) return + fetch('https://lunatranslator.xyz/toupiao_query?toupiao=1&toupiao=2&toupiao=3&toupiao=4&toupiao=5&toupiao=6&toupiao=7&toupiao=8&toupiao=9&toupiao=10').then( + (_) => { + return _.json() + } + ) + .then((res) => { + var averages = [] + + for (let idx = 0; idx < 10; idx++) { + const values = res[idx] + var average = 0; + if (values.length) { + + const sum = values.reduce((accumulator, currentValue) => accumulator + currentValue, 0); + average = sum / values.length; + } + const names = ["DeepSeek", "阿里云百炼大模型", "字节跳动豆包大模型", "月之暗面", "智谱AI", "零一万物", "硅基流动", "讯飞星火大模型", "腾讯混元大模型", "百度千帆大模型"] + + averages.push({ average: average, name: names[idx], idx: idx }) + } + averages.sort((a, b) => b.average - a.average) + for (let idx = 0; idx < 10; idx++) { + + let item = averages[idx] + toupiao.innerHTML += ` + ${item.name}${item.average} + + + + + + + ` + } + for (let i = 0; i < 10; i++) { + const values = res[i] + var average = 0; + if (values.length) { + const sum = values.reduce((accumulator, currentValue) => accumulator + currentValue, 0); + average = sum / values.length; + } + + var value = Math.floor(average) + if (value == 0) value = 1; + document.querySelector(`#rate-${i}-${value}`).checked = true + for (let ii = 0; ii < 5; ii += 1) { + document.querySelector(`#rate-${i}-${ii + 1}`).addEventListener('click', function () { + + window.open(`https://lunatranslator.xyz/toupiao_set?toupiao=${1 + Number(this.id.split('-')[1])}&value=${Number(this.id.split('-')[2])}`, '_blank'); + + }) + } + } + + + }) + + }) + }, ] } diff --git a/docs/test.bat b/docs/test.bat new file mode 100644 index 00000000..f4e3ade3 --- /dev/null +++ b/docs/test.bat @@ -0,0 +1 @@ +python -m http.server \ No newline at end of file diff --git a/docs/zh/guochandamoxing.md b/docs/zh/guochandamoxing.md index c1357073..9502918b 100644 --- a/docs/zh/guochandamoxing.md +++ b/docs/zh/guochandamoxing.md @@ -82,4 +82,11 @@ ![img](https://image.lunatranslator.xyz/zh/damoxing/qianfan2.png) - \ No newline at end of file + + + +
+ 翻译效果 + +
+
\ No newline at end of file