2021-09-30 04:18:33 +02:00
|
|
|
# System Packages
|
2021-09-30 04:02:55 +02:00
|
|
|
from enum import Enum
|
2021-09-30 04:18:33 +02:00
|
|
|
from dataclasses import dataclass
|
2021-09-30 04:02:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
class SearchType(str, Enum):
|
|
|
|
Notes = "notes"
|
|
|
|
Ledger = "ledger"
|
|
|
|
Music = "music"
|
|
|
|
Image = "image"
|
|
|
|
|
2021-09-30 04:18:33 +02:00
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class SearchSettings():
|
|
|
|
notes_search_enabled: bool = False
|
|
|
|
ledger_search_enabled: bool = False
|
|
|
|
music_search_enabled: bool = False
|
|
|
|
image_search_enabled: bool = False
|
|
|
|
|
|
|
|
|
2021-09-30 05:24:27 +02:00
|
|
|
class AsymmetricSearchModel():
|
|
|
|
def __init__(self, entries, corpus_embeddings, bi_encoder, cross_encoder, top_k):
|
|
|
|
self.entries = entries
|
|
|
|
self.corpus_embeddings = corpus_embeddings
|
|
|
|
self.bi_encoder = bi_encoder
|
|
|
|
self.cross_encoder = cross_encoder
|
|
|
|
self.top_k = top_k
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class SearchModels():
|
|
|
|
notes_search: AsymmetricSearchModel = None
|