Exemplo n.º 1
0
        public ClassifierResult GetResult(bool cleanup = true)
        {
            if (_classification == null)
            {
                return(null);
            }

            Dictionary <string, double> scoring = new Dictionary <string, double>();

            foreach (var score in _classification.IntentRanking)
            {
                scoring.Add(score.Name, score.Score);
            }

            Dictionary <string, List <IEntity> > entities = new Dictionary <string, List <IEntity> >();

            foreach (var entity in _classification.Entities)
            {
                if (entity.Score >= _minEntityConfidence)
                {
                    AddEntity(entities, entity.Group, new GroupEntity(_classification.Text.Substring(entity.Start, entity.End - entity.Start), entity.Start, entity.End, entity.Group, entity.Value, entity.Score));
                }
            }

            ClassifierResult result = new ClassifierResult(_classification.Text, scoring, entities);

            return(result);
        }
Exemplo n.º 2
0
        public ClassifierResult GetResult(bool cleanup = true)
        {
            if (_classification == null)
            {
                return(null);
            }

            Dictionary <string, double> scoring = new Dictionary <string, double>();

            foreach (var score in _classification.IntentRanking)
            {
                scoring.Add(score.Name, score.Score);
            }

            ClassifierResult result = new ClassifierResult(_classification.Text, scoring, new Dictionary <string, List <IEntity> >());

            return(result);
        }