Add Tamil NER routing and WPF test harness for POC validation.
Introduce dual-script ONNX NER routing (English/Tamil/mixed), Tamil console samples and integration tests, model download scripts, and a resizable WPF MVVM harness with click-to-load prompts, batch validation, and runtime-adjustable detection panels.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.AI;
|
||||
using PiiRedaction.Core.Abstractions;
|
||||
using PiiRedaction.Core.Configuration;
|
||||
using PiiRedaction.Core.Detection;
|
||||
using PiiRedaction.Core.Redaction;
|
||||
using PiiRedaction.Core.Sanitization;
|
||||
using PiiRedaction.Infrastructure.Llm;
|
||||
using PiiRedaction.Infrastructure.Onnx;
|
||||
|
||||
namespace PiiRedaction.TestHarness.Wpf.DependencyInjection;
|
||||
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddPiiRedactionServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.Configure<PiiRedactionOptions>(configuration.GetSection(PiiRedactionOptions.SectionName));
|
||||
|
||||
services.AddSingleton<DomainRulePiiDetector>();
|
||||
services.AddSingleton<RegexPiiDetector>();
|
||||
services.AddSingleton<OnnxNerPiiDetector>();
|
||||
|
||||
services.AddSingleton<IPiiDetector>(provider => new CompositePiiDetector(
|
||||
[
|
||||
provider.GetRequiredService<DomainRulePiiDetector>(),
|
||||
provider.GetRequiredService<RegexPiiDetector>(),
|
||||
provider.GetRequiredService<OnnxNerPiiDetector>()
|
||||
]));
|
||||
|
||||
services.AddSingleton<IPiiRedactor, PlaceholderPiiRedactor>();
|
||||
services.AddSingleton<IPromptSanitizer, PromptSanitizer>();
|
||||
|
||||
services.AddSingleton<EnglishOnnxNerRunner>();
|
||||
services.AddSingleton<TamilOnnxNerRunner>();
|
||||
services.AddSingleton<IOnnxNerModelRunner, RoutingOnnxNerModelRunner>();
|
||||
services.AddSingleton<IChatClient, MockChatClient>();
|
||||
services.AddSingleton<ILlmPromptService, MockLlmPromptService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user