splade4elastic
1.0.0
一個簡單的查詢擴展包裝器,用於彈性搜索,它使用關鍵字自定義權重,該自定義權重從擁抱面遮罩的語言模型變壓器中得出。
from splade4elastic import SpladeRewriter
model_name = "roberta-base"
splader = SpladeRewriter(model_name)
test_texts = [
"My name is John",
"The quick brown fox jumps over the lazy dog",
"I like to eat apples",
]
for test_text in test_texts:
print(test_text)
print(splader.query_expand(test_text))