<commit_before>package com.unidev.polydata.insights.controller;

import com.unidev.platform.j2ee.common.WebUtils;
import com.unidev.polydata.domain.BasicPoly;
import com.unidev.polydata.insights.model.HateoasResponse;
import com.unidev.polydata.insights.model.InsightQuery;
import com.unidev.polydata.insights.model.InsightRequest;
import com.unidev.polydata.insights.service.PolyInsights;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * API controller
 */
@RestController("/api")
public class APIController {

    @Autowired
    private PolyInsights polyInsights;

    @Autowired
    private WebUtils webUtils;

    @PostMapping("/insight")
    public void insight(@RequestBody InsightRequest insightRequest, HttpServletRequest httpServletRequest) {
        String clientIp = webUtils.getClientIp(httpServletRequest);
        String clientId = httpServletRequest.getHeader("ClientId");
        BasicPoly basicPoly = new BasicPoly();
        basicPoly.put("clientId", clientId);
        polyInsights.logInsight(insightRequest, clientIp + ":" + clientId, basicPoly);
    }

    @PostMapping("/insight/value/sum")
    public HateoasResponse listTopKeysByValueSum(@RequestBody InsightQuery insightQuery) {
        return HateoasResponse.hateoasResponse(polyInsights.listTopKeysByValueSum(insightQuery));
    }

    @PostMapping("/insight/value/average")
    public HateoasResponse listTopKeysByAverageValue(@RequestBody InsightQuery insightQuery) {
        return HateoasResponse.hateoasResponse(polyInsights.listTopKeysByAverageValue(insightQuery));
    }

    @PostMapping("/insight/key")
    public HateoasResponse fetchInsightStatsByKey(@RequestBody InsightQuery insightQuery) {
        return HateoasResponse.hateoasResponse(polyInsights.fetchInsightStatsByKey(insightQuery));
    }

}
<commit_msg>API paths updated<commit_after>package com.unidev.polydata.insights.controller;

import com.unidev.platform.j2ee.common.WebUtils;
import com.unidev.polydata.domain.BasicPoly;
import com.unidev.polydata.insights.model.HateoasResponse;
import com.unidev.polydata.insights.model.InsightQuery;
import com.unidev.polydata.insights.model.InsightRequest;
import com.unidev.polydata.insights.service.PolyInsights;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * API controller
 */
@RestController("/api")
public class APIController {

    @Autowired
    private PolyInsights polyInsights;

    @Autowired
    private WebUtils webUtils;

    @PostMapping("/api/insight")
    public void insight(@RequestBody InsightRequest insightRequest, HttpServletRequest httpServletRequest) {
        String clientIp = webUtils.getClientIp(httpServletRequest);
        String clientId = httpServletRequest.getHeader("ClientId");
        BasicPoly basicPoly = new BasicPoly();
        basicPoly.put("clientId", clientId);
        polyInsights.logInsight(insightRequest, clientIp + ":" + clientId, basicPoly);
    }

    @PostMapping("/api/insight/value/sum")
    public HateoasResponse listTopKeysByValueSum(@RequestBody InsightQuery insightQuery) {
        return HateoasResponse.hateoasResponse(polyInsights.listTopKeysByValueSum(insightQuery));
    }

    @PostMapping("/api/insight/value/average")
    public HateoasResponse listTopKeysByAverageValue(@RequestBody InsightQuery insightQuery) {
        return HateoasResponse.hateoasResponse(polyInsights.listTopKeysByAverageValue(insightQuery));
    }

    @PostMapping("/api/insight/key")
    public HateoasResponse fetchInsightStatsByKey(@RequestBody InsightQuery insightQuery) {
        return HateoasResponse.hateoasResponse(polyInsights.fetchInsightStatsByKey(insightQuery));
    }

}

{'fraction_non_alphanumeric': 0.09500727096461464, 'fraction_numerical': 0.0004847309743092584, 'mean_word_length': 5.320061255742726, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1224340', 'n_tokens_mistral': 1207, 'n_tokens_neox': 1206, 'n_words': 174}