Ejemplo n.º 1
0
        public static async Task <LabellingJob> CreateLabellingJob(ILabellingJobRepository jobRepo,
                                                                   IJobIterationRepository iterationRepo, IDataStore dataStore, IPredictiveModel model,
                                                                   ISelectionStrategy selectionStrategy, IStoppingCriterion stoppingCriterion,
                                                                   ISeedingStrategy seedingStrategy, IJobIterationNotifier notifier, IDataFormat dataFormat,
                                                                   int batchSize, int seedSize)
        {
            var job = new LabellingJob()
            {
                JobID             = Guid.NewGuid(),
                DataStore         = dataStore,
                Model             = model,
                SelectionStrategy = selectionStrategy,
                StoppingCriterion = stoppingCriterion,
                DataFormat        = dataFormat,
                BatchSize         = batchSize
            };

            await jobRepo.Add(job);

            JobIteration iteration = new JobIteration()
            {
                JobID = job.JobID,
                PreviousIterationID = Guid.Empty,
                QueryIDs            = (await seedingStrategy.GetQueryIDs(dataStore, dataFormat, seedSize)).ToArray()
            };

            await iterationRepo.Add(iteration);

            notifier.OnLabelsRequested(iteration);

            return(job);
        }
Ejemplo n.º 2
0
        public static async Task <JobIteration> GetSeedIteration(LabellingJob labellingJob, IJobIterationRepository iterationRepo, ISeedingStrategy seedingStrategy, IDataFormat dataFormat)
        {
            IDataStore   ds        = labellingJob.DataStore;
            JobIteration iteration = new JobIteration()
            {
                JobID = labellingJob.JobID,
                PreviousIterationID = Guid.Empty,
                QueryIDs            = (await seedingStrategy.GetQueryIDs(ds, dataFormat, 3)).ToArray()
            };

            await iterationRepo.Add(iteration);

            return(iteration);
        }