Ejemplo n.º 1
0
 public DocumentAnomalyDetector(DocumentBlock document, IAnomalyFilterFactory factory, IDocumentReconstructor reconstructor, int windowSize = 3)
 {
     this.document      = document ?? throw new ArgumentNullException(nameof(document));
     this.factory       = factory ?? throw new ArgumentNullException(nameof(factory));
     this.reconstructor = reconstructor ?? throw new ArgumentNullException(nameof(reconstructor));
     WindowSize         = windowSize;
 }
Ejemplo n.º 2
0
 public SvmModelStorage(ILoggerFactory factory, IDocumentVectorSource vectorSource, IDocumentReconstructor reconstructor)
 {
     this.vectorSource  = vectorSource ?? throw new ArgumentNullException(nameof(vectorSource));
     this.factory       = factory ?? throw new ArgumentNullException(nameof(factory));
     this.reconstructor = reconstructor ?? throw new ArgumentNullException(nameof(reconstructor));
     logger             = factory.CreateLogger <SvmModelStorage>();
 }
Ejemplo n.º 3
0
 public void SetUp()
 {
     loggerFactory         = new NullLoggerFactory();
     vectorSource          = new EmbeddingVectorSource(WordModel.Load(Path.Combine(TestContext.CurrentContext.TestDirectory, @"Data\model.bin")));
     documentReconstructor = new DocumentReconstructor();
     documents             = JsonConvert.DeserializeObject <Document[]>(File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, "Data", "docs.json")));
     instance = CreateModelStorage();
 }
Ejemplo n.º 4
0
 public SvmModelStorageFactory(ILoggerFactory factory, IDocumentVectorSource vectorSource, IDocumentReconstructor reconstructor, StorageConfig config)
 {
     this.factory       = factory ?? throw new ArgumentNullException(nameof(factory));
     this.vectorSource  = vectorSource ?? throw new ArgumentNullException(nameof(vectorSource));
     this.reconstructor = reconstructor ?? throw new ArgumentNullException(nameof(reconstructor));
     this.config        = config ?? throw new ArgumentNullException(nameof(config));
     if (config.Location == null)
     {
         throw new ArgumentNullException(nameof(config.Location));
     }
 }