Example #1
0
        public async Task <FCMomentStatisticsResponse> GetFCMomentStatisticsAsync(LabelingStatisticRequest request)
        {
            var agentIds = await GetAgentsForStatistics(request);

            var fcMomentsStatistics = await labelingStatisticRepository.GetFCMomentStatisticsAsync(agentIds, request.FromDate, request.ToDate);

            if (!fcMomentsStatistics.Any())
            {
                return(new FCMomentStatisticsResponse());
            }

            return(new FCMomentStatisticsResponse
            {
                Statistic = fcMomentsStatistics,
                AggregatedStatistic = FormFCMomentAggregatedStatistic(fcMomentsStatistics)
            });
        }
 public async Task <FCMomentStatisticsResponse> GetMomentsPredictionStatistics([FromBody] LabelingStatisticRequest request)
 => await labelingStatisticsService.GetFCMomentStatisticsAsync(request);
 public async Task <TranscriptionStatisticsResponse> GetTranscriptionStatistics([FromBody] LabelingStatisticRequest request)
 => await labelingStatisticsService.GetTranscriptionStatisticsAsync(request);
 public async Task <GeneralLabelingStatisticResponse> GetGeneralStatistics([FromBody] LabelingStatisticRequest request)
 => await labelingStatisticsService.GetGeneralStatisticsAsync(request);
Example #5
0
        public async Task <TranscriptionStatisticsResponse> GetTranscriptionStatisticsAsync(LabelingStatisticRequest request)
        {
            var agentIds = await GetAgentsForStatistics(request);

            var transcriptionsStatistics = await labelingStatisticRepository.GetTranscriptionStatisticsAsync(agentIds, request.FromDate, request.ToDate);

            if (!transcriptionsStatistics.Any())
            {
                return(new TranscriptionStatisticsResponse());
            }

            return(new TranscriptionStatisticsResponse
            {
                Statistic = transcriptionsStatistics,
                AggregatedStatistic = FormTranscriptionAggregatedStatistic(transcriptionsStatistics)
            });
        }
Example #6
0
        public async Task <GeneralLabelingStatisticResponse> GetGeneralStatisticsAsync(LabelingStatisticRequest request)
        {
            var agentIds = await GetAgentsForStatistics(request);

            var generalStatistics = await labelingStatisticRepository.GetGeneralStatisticsAsync(agentIds, request.FromDate, request.ToDate);

            if (!generalStatistics.Any())
            {
                return(new GeneralLabelingStatisticResponse());
            }

            return(new GeneralLabelingStatisticResponse
            {
                Statistic = generalStatistics,
                AggregatedStatistic = FormGeneralAggregatedStatistic(generalStatistics)
            });
        }
Example #7
0
 private async Task <long[]> GetAgentsForStatistics(LabelingStatisticRequest request)
 {
     return(request.AgentIds.Any()
         ? request.AgentIds
         : (await userService.GetUsersWithClaimAsync(CustomClaims.ConversationTranscriber)).Select(user => user.Id).ToArray());
 }