Ejemplo n.º 1
0
        private static async Task VerifyPackageIdsExistAsync(SearchScorerSettings settings, HttpClient httpClient)
        {
            var searchClient = new SearchClient(httpClient);
            var validator    = new PackageIdPatternValidator(searchClient);

            // Verify all desired package IDs exist.
            var feedback = FeedbackSearchQueriesCsvReader
                           .Read(settings.FeedbackSearchQueriesCsvPath)
                           .SelectMany(x => x.MostRelevantPackageIds);

            var curated = CuratedSearchQueriesCsvReader
                          .Read(settings.CuratedSearchQueriesCsvPath)
                          .SelectMany(x => x.PackageIdToScore.Keys);

            var clientCurated = CuratedSearchQueriesCsvReader
                                .Read(settings.ClientCuratedSearchQueriesCsvPath)
                                .SelectMany(x => x.PackageIdToScore.Keys);

            Console.WriteLine("Searching for non-existent package IDs");
            var allPackageIds         = feedback.Concat(curated);
            var nonExistentPackageIds = await validator.GetNonExistentPackageIdsAsync(allPackageIds, settings);

            Console.WriteLine();
            Console.WriteLine($"Found {nonExistentPackageIds.Count}.");
            foreach (var packageId in nonExistentPackageIds)
            {
                Console.WriteLine($" - {packageId}");
            }
        }
        public static IReadOnlyList <SearchQueryRelevancyScores <CuratedSearchQuery> > FromClientCuratedSearchQueriesCsv(SearchScorerSettings settings)
        {
            var queries = CuratedSearchQueriesCsvReader.Read(
                settings.ClientCuratedSearchQueriesCsvPath,
                settings.CuratedSearchQueriesCsvPath);

            return(FromCuratedSearchQueries(queries));
        }
Ejemplo n.º 3
0
        private static void ShowCurationCoverage(SearchScorerSettings settings)
        {
            Console.WriteLine("Search query curation");
            Console.WriteLine("=====================");
            ShowCurationCoverage(
                TopSearchQueriesCsvReader.Read(settings.TopSearchQueriesCsvPath),
                CuratedSearchQueriesCsvReader.Read(settings.CuratedSearchQueriesCsvPath));

            Console.WriteLine();

            Console.WriteLine("Client search query curation");
            Console.WriteLine("============================");
            ShowCurationCoverage(
                TopClientSearchQueriesCsvReader.Read(settings.TopClientSearchQueriesCsvPath),
                CuratedSearchQueriesCsvReader.Read(
                    settings.ClientCuratedSearchQueriesCsvPath,
                    settings.CuratedSearchQueriesCsvPath));
        }