Spaces:
Sleeping
Sleeping
from abc import ABC, abstractmethod | |
from typing import Any, Dict, Type | |
class BaseRetriever(ABC): | |
def index_class(self) -> Type[Any]: | |
pass | |
def get_term_weights(self, query: str, cid: str) -> Dict[str, float]: | |
raise NotImplementedError | |
def score(self, query: str, cid: str) -> float: | |
pass | |
def retrieve(self, query: str, topk: int = 10) -> Dict[str, float]: | |
pass | |