예제 #1
0
        private void SetupAnomaly(ContainerBuilder builder)
        {
            logger.LogInformation("Setting up lexicon libraries");
            var tagger = new NaivePOSTagger(new BNCList(), WordTypeResolver.Instance);

            builder.RegisterInstance(tagger).As <IPOSTagger>();

            var dictionary = new NRCDictionary();

            dictionary.Load();
            builder.RegisterInstance(dictionary).As <INRCDictionary>();

            var inquirer = new InquirerManager();

            inquirer.Load();
            builder.RegisterInstance(inquirer).As <IInquirerManager>();

            builder.RegisterType <FrequencyListManager>().As <IFrequencyListManager>().SingleInstance();
            builder.RegisterType <StyleFactory>().As <IStyleFactory>();
            builder.RegisterType <AnomalyFactory>().As <IAnomalyFactory>();
            builder.RegisterType <SupervisedAnomaly>().As <ISupervisedAnomaly>();
            builder.RegisterType <DocumentReconstructor>().As <IDocumentReconstructor>();
            builder.RegisterType <DocumentExtractor>().As <IDocumentExtractor>();

            builder.RegisterType <EmbeddingVectorSource>().As <IDocumentVectorSource>();
            builder.RegisterType <SvmModelStorageFactory>().As <IModelStorageFactory>();

            logger.LogInformation("Downloading model...");
            var model = new Uri(Configuration["Anomaly:model"]);

            new DataDownloader(loggerFactory).DownloadFile(model, "resources").Wait();
            builder.Register(context => WordModel.Load("resources/model.bin")).SingleInstance();
        }
예제 #2
0
        public void Setup()
        {
            PosTagger = new NaivePOSTagger(new BNCList(), WordTypeResolver.Instance);
            var inquirer = new InquirerManager();

            inquirer.Load();
            StyleFactory = new StyleFactory(PosTagger, new NRCDictionary(), new FrequencyListManager(), inquirer);
            var factory = new SentenceTokenizerFactory(PosTagger, new RawWordExtractor(new BasicEnglishDictionary(), new MemoryCache(new MemoryCacheOptions())));

            Extraction = new SimpleWordsExtraction(factory.Create(true, false));
        }
예제 #3
0
 public void Setup()
 {
     Manager = new InquirerManager();
     Manager.Load();
 }