From 3bcb7f42c1005904963e1d131e2482fe520fed25 Mon Sep 17 00:00:00 2001 From: Daoud Clarke Date: Tue, 9 Aug 2022 22:56:12 +0100 Subject: [PATCH] Use heuristic ranker --- mwmbl/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mwmbl/main.py b/mwmbl/main.py index 7c4287e..d1231d9 100644 --- a/mwmbl/main.py +++ b/mwmbl/main.py @@ -1,13 +1,13 @@ import argparse import logging import os -import pickle import sys from multiprocessing import Process, Queue from pathlib import Path import uvicorn from fastapi import FastAPI + from mwmbl import background from mwmbl.crawler import app as crawler from mwmbl.indexer.batch_cache import BatchCache @@ -15,7 +15,7 @@ from mwmbl.indexer.paths import INDEX_NAME, BATCH_DIR_NAME from mwmbl.tinysearchengine import search from mwmbl.tinysearchengine.completer import Completer from mwmbl.tinysearchengine.indexer import TinyIndex, Document, NUM_PAGES, PAGE_SIZE -from mwmbl.tinysearchengine.ltr_rank import LTRRanker +from mwmbl.tinysearchengine.rank import HeuristicRanker logging.basicConfig(stream=sys.stdout, level=logging.INFO) @@ -58,9 +58,9 @@ def run(): completer = Completer() with TinyIndex(item_factory=Document, index_path=index_path) as tiny_index: - # ranker = HeuristicRanker(tiny_index, completer) - model = pickle.load(open(MODEL_PATH, 'rb')) - ranker = LTRRanker(model, tiny_index, completer) + ranker = HeuristicRanker(tiny_index, completer) + # model = pickle.load(open(MODEL_PATH, 'rb')) + # ranker = LTRRanker(model, tiny_index, completer) # Initialize FastApi instance app = FastAPI()