Beispiel #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);
        }
 public double Probability(IProcessingTextBlock data)
 {
     logger.LogDebug("Probability");
     double[][] observations = vectorSource.GetVectors(new[] { data }, NormalizationType.None);
     return(Model.Probability(observations[0]));
 }
Beispiel #3
0
        public VectorData GetVector(IProcessingTextBlock textBlock, NormalizationType normalization)
        {
            var currentVector = model.GetParagraphVector(textBlock.Sentences);

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