コード例 #1
0
        public VectorData GetVector(IProcessingTextBlock normalBlock, NormalizationType normalization)
        {
            var      normal = styleFactory.ConstructTextBlock(normalBlock.Sentences);
            DataTree tree;

            switch (anomalyVectorType)
            {
            case AnomalyVectorType.Full:
                tree = new DataTree(normal, MapFull);
                break;

            case AnomalyVectorType.Inquirer:
                tree = normal.InquirerFinger.InquirerProbabilities;
                break;

            case AnomalyVectorType.SentimentCategory:
                tree = GetTree(normal);
                break;

            default:
                throw new ArgumentOutOfRangeException("AnomalyVectorType");
            }

            VectorData vector = tree.CreateVector(normalization);

            return(vector);
        }
コード例 #2
0
 public double Probability(IProcessingTextBlock data)
 {
     logger.LogDebug("Probability");
     double[][] observations = vectorSource.GetVectors(new[] { data }, NormalizationType.None);
     return(Model.Probability(observations[0]));
 }
コード例 #3
0
        public VectorData GetVector(IProcessingTextBlock textBlock, NormalizationType normalization)
        {
            var currentVector = model.GetParagraphVector(textBlock.Sentences);

            return(vectorDataFactory.CreateSimple(normalization, Convert(currentVector)));
        }
コード例 #4
0
 public bool Predict(IProcessingTextBlock data)
 {
     logger.LogDebug("Predict");
     double[][] observations = vectorSource.GetVectors(new[] { data }, NormalizationType.None);
     return(Model.Decide(observations[0]));
 }