| 623 | * ist schlicht das bessere. |
| 624 | */ |
| 625 | const winnerOf = (modelClass) => { |
| 626 | const field = models.filter((model) => model.modelClass === modelClass); |
| 627 | if (field.length === 0) { |
| 628 | return undefined; |
| 629 | } |
| 630 | const ranked = [...field].sort((a, b) => |
| 631 | (b.passRate - a.passRate) |
| 632 | || (b.citationCompliance - a.citationCompliance) |
| 633 | || (b.meanTokPerSec - a.meanTokPerSec)); |
| 634 | const winner = ranked[0]; |
| 635 | const runnerUp = ranked[1]; |
| 636 | return { |
| 637 | name: winner.name, |
| 638 | file: winner.file, |
| 639 | passRate: winner.passRate, |
| 640 | citationCompliance: winner.citationCompliance, |
| 641 | meanTokPerSec: winner.meanTokPerSec, |
| 642 | begruendung: runnerUp === undefined |
| 643 | ? `einziger Kandidat der Klasse ${modelClass}.` |
| 644 | : `passRate ${winner.passRate} gegen ${runnerUp.passRate} (${runnerUp.name}); ` |
| 645 | + `Zitattreue ${winner.citationCompliance} gegen ${runnerUp.citationCompliance}; ` |
| 646 | + `${winner.meanTokPerSec} gegen ${runnerUp.meanTokPerSec} tok/s. ` |
| 647 | + 'Score ist die Trefferquote, Gleichstand entscheidet die Zitattreue, dann das Tempo.', |
| 648 | }; |
| 649 | }; |
| 650 | |
| 651 | const report = { |
| 652 | temperature: 0, |