SF-3777 Retrieve confidence data and calculate book level scores#3876
SF-3777 Retrieve confidence data and calculate book level scores#3876pmachapman wants to merge 7 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3876 +/- ##
==========================================
+ Coverage 81.05% 81.16% +0.11%
==========================================
Files 630 635 +5
Lines 40690 40924 +234
Branches 6603 6633 +30
==========================================
+ Hits 32983 33218 +235
+ Misses 6673 6663 -10
- Partials 1034 1043 +9 ☔ View full report in Codecov by Sentry. |
d198099 to
a2f3758
Compare
|
📸 Screenshot diff deployed! (4 changes) View the visual diff at: https://pr-3876--sf-screenshot-diffs.netlify.app |
RaymondLuong3
left a comment
There was a problem hiding this comment.
It is exciting to be one step closer to introducing book and chapter level quality estimates to users!
@RaymondLuong3 reviewed 33 files and all commit messages, and made 7 comments.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on pmachapman).
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.ts line 269 at r3 (raw file):
} else { this.buildConfidencesExportService.exportCsv(rows, this.dateRange$.value); }
I think this should be exportRsv.
Code quote:
} else {
this.buildConfidencesExportService.exportCsv(rows, this.dateRange$.value);
}src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.ts line 278 at r3 (raw file):
} else { this.buildConfidencesExportService.exportCsv(rows, this.dateRange$.value); }
I think this should be exportTsv
Code quote:
} else {
this.buildConfidencesExportService.exportCsv(rows, this.dateRange$.value);
}src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/build-confidences/display-confidence.component.html line 11 at r2 (raw file):
<div class="confidence red"><mat-icon>warning</mat-icon> Likely poor quality</div> } }
Looks like this is likely to be shown to the user and needs to be localized. Oh yes, I see below you mention that this is only visible from the serval admin tab right now.
Code quote:
@switch (usabilityLabel) {
@case ("Green") {
<div class="confidence green"><mat-icon>check</mat-icon> Likely good quality</div>
}
@case ("Yellow") {
<div class="confidence yellow"><mat-icon class="filled">circle</mat-icon> Likely moderate quality</div>
}
@case ("Red") {
<div class="confidence red"><mat-icon>warning</mat-icon> Likely poor quality</div>
}
}src/SIL.XForge.Scripture/Services/MachineApiService.cs line 3100 at r3 (raw file):
List<ScriptureSegmentUsability> _, // We do not require segment level confidence values List<ScriptureChapterUsability> usabilityChapters, List<ScriptureBookUsability> usabilityBooks
I know the name is already in Machine so I understand why the variables are named this way, but I have a hard time understanding the meaning of usabilityChapters and usabilityBooks. However, I'm not sure I have a good suggestion
Code quote:
List<ScriptureSegmentUsability> _, // We do not require segment level confidence values
List<ScriptureChapterUsability> usabilityChapters,
List<ScriptureBookUsability> usabilityBookssrc/SIL.XForge.Scripture/Services/PreTranslationService.cs line 68 at r3 (raw file):
// Get the references - old builds will only have Refs specified, // newer builds will have TargetRefs with Refs containing the same values List<string> references = [.. preTranslation.TargetRefs];
It seems strange that old builds use Refs, but this code is changing it from using TargetRefs to TargetRefs or Refs. This seems to me that we are introducing Refs as a new fallback. What am I missing?
Code quote:
// Get the references - old builds will only have Refs specified,
// newer builds will have TargetRefs with Refs containing the same values
List<string> references = [.. preTranslation.TargetRefs];test/SIL.XForge.Scripture.Tests/Services/MachineApiServiceTests.cs line 2335 at r3 (raw file):
); using (Assert.EnterMultipleScope())
This is neat. I haven't encountered this before, but nice to see a way to identify multiple failures within a block.
Code quote:
using (Assert.EnterMultipleScope())
pmachapman
left a comment
There was a problem hiding this comment.
@pmachapman made 5 comments and resolved 1 discussion.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on RaymondLuong3).
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.ts line 269 at r3 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
I think this should be exportRsv.
Done. Thank you!
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.ts line 278 at r3 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
I think this should be exportTsv
Done. Thank you!
src/SIL.XForge.Scripture/ClientApp/src/app/translate/draft-generation/build-confidences/display-confidence.component.html line 11 at r2 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
Looks like this is likely to be shown to the user and needs to be localized. Oh yes, I see below you mention that this is only visible from the serval admin tab right now.
This will be localized when the wording is finalized. I thought it might be a bit of a waste of effort to localize it at this early stage.
src/SIL.XForge.Scripture/Services/MachineApiService.cs line 3100 at r3 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
I know the name is already in Machine so I understand why the variables are named this way, but I have a hard time understanding the meaning of
usabilityChaptersandusabilityBooks. However, I'm not sure I have a good suggestion
I agree - the names are from the names used by machine, which are consistent with silnlp. I'm not sure what else to call them, without breaking that consistency.
src/SIL.XForge.Scripture/Services/PreTranslationService.cs line 68 at r3 (raw file):
Previously, RaymondLuong3 (Raymond Luong) wrote…
It seems strange that old builds use Refs, but this code is changing it from using
TargetRefstoTargetRefsorRefs. This seems to me that we are introducingRefsas a new fallback. What am I missing?
Refs are used by the old corpora format, which does not have TargetRefs specified (this code fixes a bug I noticed). The new corpora format uses TargetRefs/SourceRefs. SF should use SourceRefs, but these are currently blank in Serval due to a bug which is being fixed in the next release. When that is done, I will need to implement support for SourceRefs for drafts made with that version of Serval onwards.
RaymondLuong3
left a comment
There was a problem hiding this comment.
@RaymondLuong3 reviewed 4 files and all commit messages, made 1 comment, and resolved 5 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on pmachapman).
src/SIL.XForge.Scripture/Services/PreTranslationService.cs line 68 at r3 (raw file):
Previously, pmachapman (Peter Chapman) wrote…
Refs are used by the old corpora format, which does not have TargetRefs specified (this code fixes a bug I noticed). The new corpora format uses TargetRefs/SourceRefs. SF should use SourceRefs, but these are currently blank in Serval due to a bug which is being fixed in the next release. When that is done, I will need to implement support for SourceRefs for drafts made with that version of Serval onwards.
Ok, got it. Thanks for the extra details.
This PR adds a card to the Serval Builds tab with Quality Estimation, allowing downloading of book and chapter data in a format very similar to SILNLP:
This change is