File size: 613 Bytes
94e8fb8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from types import SimpleNamespace

metrics_cfg = SimpleNamespace(
    metric="cosine",
    threshold=0.5,
)

db_cfg = SimpleNamespace(
    db_name="lancedb",
    table_name="MiniLM-L12-v",
    folder_path="database",
    metrics=metrics_cfg
)

model_cfg = SimpleNamespace(
    language="ukr",
    name="sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
    task="sentence-transformers",
)

CFG = SimpleNamespace(
    vocab_path="data/ukrainian_nouns.txt",
    model=model_cfg,
    db=db_cfg,
)

with open(CFG.vocab_path, "r") as file:
    AVAILABLE_WORDS = [line.strip() for line in file.readlines()]