/// <summary>Defines document selection query parameters</summary>
 /// <remarks><para>It will set the parameters to the current DSQ instance. For query text to be used you should have at least one TermWeight factor in the DS ScoreModel</para></remarks>
 /// <param name="docLimit">Number of documents to be selected</param>
 /// <param name="trashold">Score min limit, leave 0 to disable score limit</param>
 /// <param name="query">Text of the query to be used for document score operation</param>
 /// <seealso cref="aceOperationSetExecutorBase"/>
 public void aceOperation_setDocumentSelectionQuery(
     [Description("Number of documents to be selected")] Int32 docLimit = 3,
     [Description("Score min limit, leave 0 to disable score limit")] Double trashold        = 0.0,
     [Description("Text of the query to be used for document score operation")] String query = " ",
     [Description("Result is limited to [docLimit] by domain level, not in total")] DocumentSelectQueryOptions options = DocumentSelectQueryOptions.ApplyDomainLevelLimits)
 {
     data.ranking.query               = new DocumentSelectQuery();
     data.ranking.query.QueryTerms    = query;
     data.ranking.query.SizeLimit     = docLimit;
     data.ranking.query.TrasholdLimit = trashold;
     data.ranking.query.options       = options;
 }
Exemple #2
0
        /// <summary>Classification procedure with document selection using precompiled ranking file</summary>
        /// <remarks><para>Loads external document selection score table, applies query filter over input dataset and performs classification evaluation</para></remarks>
        /// <param name="outputName">Name for result</param>
        /// <param name="DSFilename">Name of Document Selection ranking file</param>
        /// <param name="DSCount">Number of documents to be selected</param>
        /// <seealso cref="aceOperationSetExecutorBase"/>
        public void aceOperation_runClassificationWithDS(
            [Description("Name for result")] String outputName = "word",
            [Description("Name of Document Selection ranking file")] String DSFilename = "",
            [Description("Number of documents to be selected")] Int32 DSCount          = 5,
            [Description("Query options")]  DocumentSelectQueryOptions options         = DocumentSelectQueryOptions.none,
            [Description("Skip existing experiment")]  Boolean skipExisting            = true)
        {
            SetupDocumentClassification setup = docClassification.data.CloneViaXML();

            setup.LearnFrom(mainContext.procedureCommons);

            setup.OutputFilename = outputName;

            setup.documentSelectQuery = docSelection.data.ranking.query.CloneViaXML();

            //docClassification.data.documentSelectQuery.

            // setup.documentSelectQuery = docSelection.data.ranking.query.CloneViaXML();

            setup.documentSelectQuery.PrecompiledScoresFilename = DSFilename;

            setup.documentSelectQuery.SizeLimit = DSCount;

            if (options != DocumentSelectQueryOptions.none)
            {
                setup.documentSelectQuery.options = options;
            }

            //setup.reportOptions = mainContext.reportOptions;

            ProceduralFolderFor <ProcedureClassification, SetupDocumentClassification, OperationContext, ExperimentModelExecutionContext> procedures
                = new ProceduralFolderFor <ProcedureClassification, SetupDocumentClassification, OperationContext, ExperimentModelExecutionContext>(mainContext.folds, setup, mainContext.notes, parent);

            //  contextSet = procedures.Execute(mainContext.ParallelThreads, output, contextSet, mainContext);

            proceduralStack.Push(procedures);
        }