File size: 486 Bytes
83ce2de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()