AI识别 增加标题检测
This commit is contained in:
1 parent
be76e62ddd
commit
3f11ae23bd
2 files changed
+17
-1
No files matched your search
@@ -50,6 +50,15 @@ internal static class GoodsComplianceSmoke
|
||||
Check(words.Length == 5);
|
||||
Check(GoodsComplianceService.Matches("ABC广告", words).SequenceEqual(new[] { "广告", "abc" }));
|
||||
Check(GoodsComplianceService.Matches("普通商品", words).Length == 0);
|
||||
// Exercise detection without calling the reporting API.
|
||||
var detect = typeof(GoodsComplianceService).GetMethod("DetectProductAsync",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
||||
var titleHit = ((System.Threading.Tasks.Task<ComplianceResult>)detect.Invoke(null, new object[]
|
||||
{
|
||||
new Product { ProductId = "title", Title = "ABC广告" }, new ComplianceOptions(), words, null,
|
||||
System.Threading.CancellationToken.None
|
||||
})).GetAwaiter().GetResult();
|
||||
Check(titleHit.Status == "有风险" && titleHit.Summary == "有风险:标题命中关键词:广告,abc");
|
||||
var invalidImage = new Product { ProductId = "bad-image", MainImages = new List<string> { "file:///image.jpg" } };
|
||||
var statuses = new List<string>();
|
||||
GoodsComplianceService.DetectSelectedAsync(new[] { cloud }, item => invalidImage,
|
||||
|
||||
Reference in new issue
Block a user