Libraryless. Click here for Pure Java version (3776L/24K).
1 | svoid ai_combineBestNGramScorersForLanguageDetectionTask(LanguageDetectionTask task) { |
2 | LS exprs = takeFirst(10, (LS) dm_callAndImport(dm_languageDetectionNGramScorersCRUD(), 'expressionsForTaskByScore, task.task())); |
3 | |
4 | Set<S> seen = ciSet(); |
5 | new DynamicTopTen<S> tt; |
6 | |
7 | repeat 1000 { |
8 | S expr = firstNotSeen_nAttempts(1000, seen, () -> |
9 | ai_combineNGramScorers_noDuplicates(random(exprs), random(exprs)) |
10 | ); |
11 | if (expr == null) break with print("Can't find any new expressions"); |
12 | tt.add(expr, print(scoreNGramScorer(expr, task.pos, task.neg))); |
13 | } |
14 | |
15 | pnl(tt.withScores()); |
16 | dm_saveLanguageDetectionNGramScorers(task, tt); |
17 | } |
Began life as a copy of #1027504
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027505 |
Snippet name: | ai_combineBestNGramScorersForLanguageDetectionTask |
Eternal ID of this version: | #1027505/3 |
Text MD5: | 863b3c79c7db9de607d8dac7c4747e44 |
Transpilation MD5: | 7607da1f2088dad35b0b6a04dfb4c9b7 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-03-22 16:31:59 |
Source code size: | 668 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 188 / 264 |
Version history: | 2 change(s) |
Referenced in: | [show references] |