Skip to content

Commit

Permalink
Added Estimate quality translation action
Browse files Browse the repository at this point in the history
  • Loading branch information
RiabushenkoA committed Feb 5, 2025
1 parent efa6b28 commit 355a7de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Apps.Widn/Actions/QualityActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public async Task<QualityResponse> EstimateQuality([ActionParameter] LanguageOpt


[Action("Estimate XLIFF translation quality", Description = "Estimates the quality of a translation from an XLIFF file")]
public async Task<QualityResponse> EstimateQualityXliff([ActionParameter] FileRequest input, [ActionParameter][StaticDataSource(typeof(EstimateModelDataHandler))] string model)
public async Task<QualityResponse> EstimateQualityXliff([ActionParameter] FileRequest input,
[ActionParameter][StaticDataSource(typeof(EstimateModelDataHandler))][Display("Model")] string model)
{
if (input.File == null)
throw new PluginMisconfigurationException("XLIFF file cannot be null. Please provide a valid file.");
Expand Down
2 changes: 1 addition & 1 deletion Apps.Widn/DataSources/Enums/EstimateModelDataHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class EstimateModelDataHandler : IStaticDataSourceItemHandler
{
public IEnumerable<DataSourceItem> GetData() => new List<DataSourceItem>()
{
new("mqm-qe", "Anthill"),
new("mqm-qe", "Mqm-qe"),
new("xcomet-xl", "Xcomet-xl")
};
}
Expand Down
2 changes: 1 addition & 1 deletion Tests.Widn/TranslateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task GetQualityXLIFF_ReturnsValues()
{
File = new FileReference { Name = "translated.xliff" },
};
var result = await action.EstimateQualityXliff(input);
var result = await action.EstimateQualityXliff(input, "mqm-qe");
Assert.IsNotNull(result);
Console.WriteLine($"Final Score: {result.Score}");
Assert.IsTrue(result.Score > 0);
Expand Down

0 comments on commit 355a7de

Please sign in to comment.