Example #1
0
        public static TransformFunction Create(string funcName, string[] parameters, int idxStart)
        {
            TransformFunction transFunc;
            switch (funcName)
            {
                case "linear":
                    transFunc = new LinearTransform(parameters, idxStart);
                    break;
                case "bucket":
                    transFunc = new BucketTransform(parameters, idxStart);
                    break;
                case "rational":
                    transFunc = new RationalTransform(parameters, idxStart);
                    break;
                case "loglinear":
                    transFunc = new LogLinearTransform(parameters, idxStart);
                    break;
                case "DecisionTree":
                    transFunc = new DecisionTreeTransform(parameters, idxStart);
                    break;
                case "BM25F2":
                    transFunc = new BM25F2Transform(parameters, idxStart);
                    break;
                case "LogBM25F2":
                    transFunc = new LogBM25F2Transform(parameters, idxStart);
                    break;
                default:
                    throw new Exception("un-handled input transformation " + funcName);
            }

            return transFunc;
        }
Example #2
0
        public LogBM25F2Transform(string[] parameters, int idxStart)
        {
            //(1) parsing the LogBM25F2 section of the model configuration file
            for (int i = idxStart; i < parameters.Length; i++)
            {
                string[] fields = parameters[i].Split('=');
                string name = fields[0];
                if (string.Compare(name, "Slope", true) == 0)
                {
                    this.dblSlope = double.Parse(fields[1]);
                }
                else if (string.Compare(name, "Multiplier", true) == 0)
                {
                    this.dblMultiplier = double.Parse(fields[1]);
                }
                else if (string.Compare(name, "Intercept", true) == 0)
                {
                    this.dblIntercept = double.Parse(fields[1]);
                }
            }

            this.bm25F2Transform = new BM25F2Transform(parameters, idxStart);
        }
Example #3
0
        public LogBM25F2Transform(LogBM25F2Transform logbm25F2Transform)
        {
            this.dblSlope = logbm25F2Transform.dblSlope;
            this.dblMultiplier = logbm25F2Transform.dblMultiplier;
            this.dblIntercept = logbm25F2Transform.dblIntercept;

            this.bm25F2Transform = new BM25F2Transform(logbm25F2Transform.bm25F2Transform);
        }
Example #4
0
 public BM25F2Transform(BM25F2Transform bm25F2Transform)
 {
     this.dblSaturation = bm25F2Transform.dblSaturation;
     this.bm25Streams = bm25F2Transform.bm25Streams; ;
     this.featureTbl = bm25F2Transform.featureTbl; ;
 }