示例#1
0
 public Perceptron(string inputFile, string outputFile, List<string> tagList)
 {
     _inputFile = inputFile;
     _outputFile = outputFile;
     var tags = new Tags(tagList);
     MapFeatures = new MapFeaturesToK(inputFile, string.Concat(outputFile, ".featuresToK"), tagList);
     MapFeatures.StartMapping();
     WeightVector = new WeightVector(MapFeatures.DictFeaturesToK, MapFeatures.FeatureCount);
     _viterbiForGlobalLinearModel = new ViterbiForGlobalLinearModel(WeightVector, tags);
     InputSentences = new List<List<string>>();
     TagsList = new List<List<string>>();
     ReadInputs();
 }
        public Perceptron(List<string> inputFiles, string outputFile, List<string> tagList, bool useAvg = false)
        {
            _outputFile = outputFile;
            _useAvg = useAvg;
            var tags = new Tags(tagList);
            MapFeatures = new MapFeaturesToK(string.Concat(outputFile, ".featuresToK"), tagList);
            MapFeatures.StartMapping(inputFiles);

            WeightVector = new WeightVector(MapFeatures.DictFeaturesToK, MapFeatures.FeatureCount);
            AvgWeightVector = new WeightVector(MapFeatures.DictFeaturesToK, MapFeatures.FeatureCount);
            _viterbiForGlobalLinearModel = new ViterbiForGlobalLinearModel(WeightVector, tags);
            InputSentences = new List<List<string>>();
            TagsList = new List<List<string>>();
            //ReadInputs();
        }