Ejemplo n.º 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();
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 3
0
 public void Setup()
 {
     PosTagger = new NaivePOSTagger(new BNCList(), WordTypeResolver.Instance);
     Raw       = new RawWordExtractor(new BasicEnglishDictionary(), new MemoryCache(new MemoryCacheOptions()));
     Factory   = new SentenceTokenizerFactory(PosTagger, Raw);
 }
 public void Setup()
 {
     instance = new NaivePOSTagger(new BNCList(), WordTypeResolver.Instance);
 }