pythonでベクトル検索スニペット
code:python
import pickle
import vector_search
data = pickle.load(open(f"hoge.pickle", "rb"))
sorted_data = vector_search.get_sorted(data, query)
sorted_dataの構造
code:python
一致度,テキスト形式,コンテンツ
[[0.7459739728066912, "xxxiii Know how to Withdraw . If it is a great lesson in life to know how to deny, it is a still greater to know how to deny oneself as regards both affairs and persons. There are extraneous occupations which eat away
precious time. To be occupied in what does not concern you is worse than doing nothing. It is not enough for a careful man not to interfere with others, he must see that they do not interfere with him. One is not obliged to belong so much to all as not to belong at all to oneself. So with friends, their p. 20 help should not be abused or more demanded from them than they themselves will grant. All excess is a failing, but above all in personal intercourse. A wise moderation in this best preserves the goodwill and esteem of all, for by this means that precious boon of courtesy is not gradually worn away. Thus you preserve your genius free to select the elect, and never sin against the unwritten laws of good taste.", {"title": "Know how to Withdraw", "text": "xxxiii (略)
sorted_dataのN番目の2番目だけ使えばいい
一致度が欲しければ0番目を使う