diff --git a/src/search_type/image_search.py b/src/search_type/image_search.py index 10d429c3..5eecef31 100644 --- a/src/search_type/image_search.py +++ b/src/search_type/image_search.py @@ -193,16 +193,6 @@ def query(raw_query, count, model: ImageSearchModel): return sorted(hits, key=lambda hit: hit["score"], reverse=True) -def render_results(hits, image_names, image_directory, count): - image_directory = resolve_absolute_path(image_directory, strict=True) - - for hit in hits[:count]: - print(image_names[hit['corpus_id']]) - image_path = image_directory.joinpath(image_names[hit['corpus_id']]) - with Image.open(image_path) as img: - img.show() - - def collate_results(hits, image_names, output_directory, image_files_url, count=5) -> list[SearchResponse]: results: list[SearchResponse] = [] diff --git a/src/search_type/text_search.py b/src/search_type/text_search.py index 1ba1ed4d..3ac52745 100644 --- a/src/search_type/text_search.py +++ b/src/search_type/text_search.py @@ -125,24 +125,6 @@ def query(raw_query: str, model: TextSearchModel, rank_results: bool = False): return hits, entries -def render_results(hits, entries: list[Entry], count=5, display_biencoder_results=False): - "Render the Results returned by Search for the Query" - if display_biencoder_results: - # Output of top hits from bi-encoder - print("\n-------------------------\n") - print(f"Top-{count} Bi-Encoder Retrieval hits") - hits = sorted(hits, key=lambda x: x['score'], reverse=True) - for hit in hits[0:count]: - print(f"Score: {hit['score']:.3f}\n------------\n{entries[hit['corpus_id']].compiled}") - - # Output of top hits from re-ranker - print("\n-------------------------\n") - print(f"Top-{count} Cross-Encoder Re-ranker hits") - hits = sorted(hits, key=lambda x: x['cross-score'], reverse=True) - for hit in hits[0:count]: - print(f"CrossScore: {hit['cross-score']:.3f}\n-----------------\n{entries[hit['corpus_id']].compiled}") - - def collate_results(hits, entries: list[Entry], count=5) -> list[SearchResponse]: return [SearchResponse.parse_obj( {