internal void Handle(string medicalFile)
        {
            var localTask = textractTextService.DetectTextLocal(medicalFile);

            localTask.Wait();
            var result      = localTask.Result;
            var lineItems   = textractTextService.GetLines(result);
            var medicalTask = comprehendMedicalService.DetectEntities(string.Join("", lineItems));

            medicalTask.Wait();
            medicalTask.Result.ForEach(entity => {
                Console.WriteLine("Text: [{0}], Type: [{1}], Category: [{2}]", entity.Text, entity.Type, entity.Category);
                entity.Traits.ForEach(trait => {
                    Console.WriteLine(" Trait: [{0}], Score: [{1}]", trait.Name, trait.Score);
                });
            });
        }
Esempio n. 2
0
        internal void Handle(string localFile)
        {
            var localTask = textractTextService.DetectTextLocal(localFile);

            localTask.Wait();
            var result              = localTask.Result;
            var lineItems           = textractTextService.GetLines(result);
            var detectSentimentTask = comprehendService.DetectSentiment("en", string.Join("", lineItems));

            detectSentimentTask.Wait();
            Console.WriteLine(detectSentimentTask.Result);
            var detectEntitiesTask = comprehendService.DetectEntities("en", string.Join("", lineItems));

            detectEntitiesTask.Wait();
            detectEntitiesTask.Result.ForEach(entity => {
                Console.WriteLine("{0}:{1}:{2}", entity.Text, entity.Score, entity.Type);
            });
        }