Skip to content

Commit

Permalink
Fix key term ids logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Dec 4, 2023
1 parent 64a7b05 commit 6736525
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SIL.Machine.AspNetCore/Services/NmtPreprocessBuildJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ async IAsyncEnumerable<Pretranslation> ProcessRowsAsync()
IParallelTextCorpus parallelKeyTermsCorpus = sourceCorpora[CorpusType.Term].AlignRows(
targetCorpora[CorpusType.Term]
);
corpus.TrainOnTextIds.Add(parallelKeyTermsCorpus.Select(r => r.TextId).Distinct().First()); //Should only be one textId
IEnumerable<string> keyTermsTextIds = parallelKeyTermsCorpus.Select(r => r.TextId).Distinct();
if (keyTermsTextIds.Count() == 1)
corpus.TrainOnTextIds.Add(keyTermsTextIds.First()); //Should only be one textId for key terms
parallelCorpora.Add(parallelKeyTermsCorpus);
}

Expand Down

0 comments on commit 6736525

Please sign in to comment.