public IntelligentTaggingController(
            IWebUtilWrapper webUtil,
            ISitecoreDataWrapper dataWrapper,
            IIntelligentTaggingSettings settings,
            ISetupInformationFactory setupFactory,
            ISetupService setupService,
            IContentSearchWrapper contentSearch,
            INaturalLanguageClassifierService naturalLanguageClassifier,
            IContentService contentService,
            IContentSearchService contentSearchService,
            IClassifierFactory classifierFactory)
        {
            WebUtil                   = webUtil;
            DataWrapper               = dataWrapper;
            Settings                  = settings;
            SetupFactory              = setupFactory;
            SetupService              = setupService;
            ContentSearch             = contentSearch;
            NaturalLanguageClassifier = naturalLanguageClassifier;
            ContentService            = contentService;
            ContentSearchService      = contentSearchService;
            ClassifierFactory         = classifierFactory;

            Id       = WebUtil.GetQueryString("id");
            Language = WebUtil.GetQueryString("language");
            Database = WebUtil.GetQueryString("db");
        }
Exemplo n.º 2
0
 public ContentService(
     ISitecoreDataWrapper dataWrapper,
     IIntelligentTaggingSettings settings,
     IContentSearchWrapper contentSearch,
     IContentMappingFactory contentMappingFactory,
     IClassifierFactory classifierFactory)
 {
     DataWrapper           = dataWrapper;
     Settings              = settings;
     ContentSearch         = contentSearch;
     ContentMappingFactory = contentMappingFactory;
     ClassifierFactory     = classifierFactory;
 }
Exemplo n.º 3
0
 public ClassifierProvider(IClassifierFactory classifierFactory)
 {
     this.classifierFactory = classifierFactory;
 }
Exemplo n.º 4
0
        public static Edu.Stanford.Nlp.Classify.OneVsAllClassifier <L, F> Train <L, F>(IClassifierFactory <string, F, IClassifier <string, F> > classifierFactory, GeneralDataset <L, F> dataset, ICollection <L> trainLabels)
        {
            IIndex <L> labelIndex   = dataset.LabelIndex();
            IIndex <F> featureIndex = dataset.FeatureIndex();
            IDictionary <L, IClassifier <string, F> > classifiers = Generics.NewHashMap();

            foreach (L label in trainLabels)
            {
                int i = labelIndex.IndexOf(label);
                logger.Info("Training " + label + " = " + i + ", posIndex = " + posIndex);
                // Create training data for training this classifier
                IDictionary <L, string> posLabelMap = new ArrayMap <L, string>();
                posLabelMap[label] = PosLabel;
                GeneralDataset <string, F> binaryDataset    = dataset.MapDataset(dataset, binaryIndex, posLabelMap, NegLabel);
                IClassifier <string, F>    binaryClassifier = classifierFactory.TrainClassifier(binaryDataset);
                classifiers[label] = binaryClassifier;
            }
            Edu.Stanford.Nlp.Classify.OneVsAllClassifier <L, F> classifier = new Edu.Stanford.Nlp.Classify.OneVsAllClassifier <L, F>(featureIndex, labelIndex, classifiers);
            return(classifier);
        }
Exemplo n.º 5
0
        public static Edu.Stanford.Nlp.Classify.OneVsAllClassifier <L, F> Train <L, F>(IClassifierFactory <string, F, IClassifier <string, F> > classifierFactory, GeneralDataset <L, F> dataset)
        {
            IIndex <L> labelIndex = dataset.LabelIndex();

            return(Train(classifierFactory, dataset, labelIndex.ObjectsList()));
        }
Exemplo n.º 6
0
 public BaseIntelligentTaggingCommand()
 {
     Settings          = DependencyResolver.Current.GetService <IIntelligentTaggingSettings>();
     ContentService    = DependencyResolver.Current.GetService <IContentService>();
     ClassifierFactory = DependencyResolver.Current.GetService <IClassifierFactory>();
 }
 public ClassifierProvider(IClassifierFactory classifierFactory) {
     this.classifierFactory = classifierFactory;
 }
 public AnalysisManager(IDataSource dataSource, IClassifierFactory classifierFactory)
 {
     this.dataSource        = dataSource ?? throw new ArgumentNullException(nameof(dataSource));
     this.classifierFactory = classifierFactory ?? throw new ArgumentNullException(nameof(classifierFactory));
 }