Skip to content

Port sequence confidence changes#400

Merged
Enkidu93 merged 3 commits intomasterfrom
port_add_sequence_confidence
Apr 9, 2026
Merged

Port sequence confidence changes#400
Enkidu93 merged 3 commits intomasterfrom
port_add_sequence_confidence

Conversation

@Enkidu93
Copy link
Copy Markdown
Collaborator

@Enkidu93 Enkidu93 commented Apr 7, 2026

Many changes were not relevant to Machine (C#). My only question: For the TranslationEngines that create translation results in Machine, should I just provide a dummy -1.0 value for the sequence confidence or should I combine the individual confidences in some way to create the sequence confidence (e.g. geometric mean)?

Fixes #396.

Port changes from sillsdev/machine.py#279.


This change is Reviewable

@Enkidu93 Enkidu93 requested a review from ddaspit April 7, 2026 15:30
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 76.19048% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.00%. Comparing base (cd06553) to head (c1a8c07).

Files with missing lines Patch % Lines
src/SIL.Machine/Statistics/StatisticalMethods.cs 80.00% 0 Missing and 1 partial ⚠️
...SIL.Machine/Translation/HybridTranslationEngine.cs 0.00% 1 Missing ⚠️
...c/SIL.Machine/Translation/TranslationExtensions.cs 0.00% 1 Missing ⚠️
src/SIL.Machine/Translation/TranslationResult.cs 66.66% 1 Missing ⚠️
...IL.Machine/Translation/TranslationResultBuilder.cs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #400   +/-   ##
=======================================
  Coverage   73.00%   73.00%           
=======================================
  Files         439      439           
  Lines       36672    36685   +13     
  Branches     5036     5036           
=======================================
+ Hits        26772    26782   +10     
- Misses       8785     8788    +3     
  Partials     1115     1115           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@ddaspit reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Enkidu93).

Copy link
Copy Markdown
Collaborator Author

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddaspit, just wanted to make sure you saw my question above. I'm assuming you're OK with the -1.0 default then?

@Enkidu93 made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Enkidu93).

Copy link
Copy Markdown
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using the geometric mean of the word confidences would be good.

@ddaspit made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Enkidu93).

Copy link
Copy Markdown
Collaborator Author

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍. Since we're now using the geometric mean in a few places, I've moved it to a utility class. Let me know if it ought to be somewhere else or if you'd prefer I not do that.

@Enkidu93 made 1 comment.
Reviewable status: 3 of 7 files reviewed, all discussions resolved (waiting on ddaspit).

Copy link
Copy Markdown
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ddaspit reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on Enkidu93).


src/SIL.Machine/Utils/ConfidenceHelper.cs line 14 at r2 (raw file):

        /// <param name="values"></param>
        /// <returns>The geometric mean.</returns>
        public static double GeometricMean(IList<double> values)

Please move this to StatisticalMethods.

Copy link
Copy Markdown
Collaborator Author

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Enkidu93 made 1 comment.
Reviewable status: 3 of 8 files reviewed, 1 unresolved discussion (waiting on ddaspit).


src/SIL.Machine/Utils/ConfidenceHelper.cs line 14 at r2 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

Please move this to StatisticalMethods.

Done. A perfect spot that I didn't know existed haha. Interestingly none of the other methods in this class seem to be used anywhere in the codebase 🤔. Just curious: I guess these are more for external use then?

Copy link
Copy Markdown
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@ddaspit reviewed 5 files and all commit messages, made 2 comments, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on Enkidu93).


src/SIL.Machine/Utils/ConfidenceHelper.cs line 14 at r2 (raw file):

Previously, Enkidu93 (Eli C. Lowry) wrote…

Done. A perfect spot that I didn't know existed haha. Interestingly none of the other methods in this class seem to be used anywhere in the codebase 🤔. Just curious: I guess these are more for external use then?

Yes, these are available for external use.

@Enkidu93 Enkidu93 merged commit 8bf4e47 into master Apr 9, 2026
4 checks passed
@Enkidu93 Enkidu93 deleted the port_add_sequence_confidence branch April 9, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port 'Add sequence confidence to pretranslations'

3 participants