Cobalt / README.md
Shakshi3104
[fix] Update README
b271315
|
raw
history blame
1.27 kB
metadata
license: mit
title: Cobalt
sdk: gradio
emoji: πŸ’Ž
colorFrom: blue
colorTo: indigo
pinned: false

Cobalt: Hybrid Search

Cobalt is a demo app for hybrid search with vector and surface search using Ruri, BM25 and Voyager. The name cobalt is derived from the word η‘ η’ƒ (Ruri), which refers to cobalt glass.

Demo

This demo app is made by Gradio, deployed to Hugging Face Space.

On local, you can run this app below:

docker compose up --build

and, access to http://localhost:7860/

Usage

import pandas as pd
from model.search.hybrid import HybridSearchClient

# load documents from CSV file.
df = pd.read_csv("corpus.csv")

# Initialize search client
# Specify column name to be searched. e.g. "content"
search_client = HybridSearchClient.from_dataframe(df, "content")

# Search documents from a query
results = search_client.search_top_n("Arashi's history")

Requirements

  • Python 3.10
  • rank_bm25
  • huggingface
  • voyager
  • Other Python packages are refer to requirements.txt