示例#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;
 }
示例#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>();
 }
示例#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();
 }
示例#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));
     }
 }