Spaces:
Sleeping
Sleeping
Shakshi3104
commited on
Commit
·
c07f34c
1
Parent(s):
6d23787
[add] Add CLI example
Browse files- cli_example.py +14 -0
cli_example.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
|
3 |
+
from model.search.hybrid import HybridSearchClient
|
4 |
+
from model.data.notion_db import fetch_sakurap_corpus
|
5 |
+
|
6 |
+
|
7 |
+
if __name__ == "__main__":
|
8 |
+
# Load dataset
|
9 |
+
sakurap_df = fetch_sakurap_corpus("./data/sakurap_corpus.csv")
|
10 |
+
# sakurap_df = pd.read_csv("./data/sakurap_corpus.csv")
|
11 |
+
|
12 |
+
# hybrid search
|
13 |
+
search_client = HybridSearchClient.from_dataframe(sakurap_df, "content")
|
14 |
+
results = search_client.search_top_n("嵐 5人の歴史")
|