Shakshi3104 commited on
Commit
cb0a298
ยท
1 Parent(s): 3201f24

[fix] Update README

Browse files
Files changed (1) hide show
  1. README.md +18 -0
README.md CHANGED
@@ -2,6 +2,24 @@
2
 
3
  Cobalt is a demo app for hybrid search with vector and surface search using [Ruri](https://huggingface.co/cl-nagoya/ruri-large), [BM25](https://github.com/dorianbrown/rank_bm25) and [Voyager](https://spotify.github.io/voyager/). The name cobalt is derived from the word ็‘ ็’ƒ (Ruri), which refers to cobalt glass.
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  ## Requirements
6
 
7
  - Python 3.10
 
2
 
3
  Cobalt is a demo app for hybrid search with vector and surface search using [Ruri](https://huggingface.co/cl-nagoya/ruri-large), [BM25](https://github.com/dorianbrown/rank_bm25) and [Voyager](https://spotify.github.io/voyager/). The name cobalt is derived from the word ็‘ ็’ƒ (Ruri), which refers to cobalt glass.
4
 
5
+ ## Usage
6
+
7
+ ```python
8
+ import pandas as pd
9
+ from model.search.hybrid import HybridSearchClient
10
+
11
+ # load documents from CSV file.
12
+ df = pd.read_csv("corpus.csv")
13
+
14
+ # Initialize search client
15
+ # Specify column name to be searched. e.g. "content"
16
+ search_client = HybridSearchClient.from_dataframe(df, "content")
17
+
18
+ # Search documents from a query
19
+ results = search_client.search_top_n("Arashi's history")
20
+
21
+ ```
22
+
23
  ## Requirements
24
 
25
  - Python 3.10