Cobalt / model /search /base.py
Shakshi3104
[add] Implement base search client class
83ce2de
raw
history blame
486 Bytes
import abc
from typing import List, Union
import pandas as pd
class BaseSearchClient:
"""
検査インタフェースクラス
"""
corpus: pd.DataFrame | list | None = None
@classmethod
@abc.abstractmethod
def from_dataframe(cls, _data: pd.DataFrame, _target: str):
raise NotImplementedError()
@abc.abstractmethod
def search_top_n(self, _query: Union[List[str], str], n: int=10) -> List[pd.DataFrame]:
raise NotImplementedError()