Feature Extraction
sentence-transformers
Safetensors
Korean
English
modernbert
sparse-encoder
sparse
splade
learned-sparse-retrieval
text-embeddings-inference
Run this model with HF Jobs
Run nlpai-lab/KURE-Sparse-nano on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/nlpai-lab/KURE-Sparse-nano. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/nlpai-lab/KURE-Sparse-nano on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use nlpai-lab/KURE-Sparse-nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use nlpai-lab/KURE-Sparse-nano with sentence-transformers:
from sentence_transformers import SparseEncoder model = SparseEncoder("nlpai-lab/KURE-Sparse-nano") queries = ["Which planet is known as the Red Planet?"] documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Notebooks
- Google Colab
- Kaggle
Add API usage
Browse files22 unmodified lines2324252627289 unmodified lines38394041424323 unmodified lines67686970717222 unmodified lines# π KURE-Sparse-nano**KURE-Sparse-nano** is a compact (0.1B) Korean-English learned sparse retrieval model. It shows state-of-the-art performance among < 0.5B sparse models supporting Korean, averaging **0.7716** nDCG@10 on MTEB(kor, v2) Retrieval. It also outperforms much larger dense models, such as pplx-embed-v1-4b and harrier-oss-v1-27b.<p align="center"><img src="assets/kure_ndcg.png" width="100%" alt="Average nDCG@10 on MTEB(kor, v2) Retrieval of the KURE models and baseline retrievers">9 unmodified lines## Usage```bashpip install -U sentence-transformers```23 unmodified lines# tensor([[119.3931, 11.5758, 6.4037]])```## EvaluationKURE-Sparse-nano is evaluated on the nine **MTEB(kor, v2) Retrieval** tasks. We report nDCG@10.22 unmodified lines232425262728299 unmodified lines394041424344454623 unmodified lines70717273747576777879808182838485868788899091929394959697989910010110210310410510610710810922 unmodified lines# π KURE-Sparse-nano**KURE-Sparse-nano** is a compact (0.1B) Korean-English learned sparse retrieval model. It shows state-of-the-art performance among < 0.5B sparse models supporting Korean, averaging **0.7716** nDCG@10 on MTEB(kor, v2) Retrieval. It also outperforms much larger dense models, such as pplx-embed-v1-4b and harrier-oss-v1-27b.It is also served through the [KURE API](https://kure.kullm.ai/).<p align="center"><img src="assets/kure_ndcg.png" width="100%" alt="Average nDCG@10 on MTEB(kor, v2) Retrieval of the KURE models and baseline retrievers">9 unmodified lines## Usage### Sentence Transformers```bashpip install -U sentence-transformers```23 unmodified lines# tensor([[119.3931, 11.5758, 6.4037]])```### APIKURE-Sparse-nano is served at [kure.kullm.ai](https://kure.kullm.ai/). Sign in with GitHub there to get an API key.```pythonimport osimport requestsURL = "https://kure.kullm.ai/api/v1/sparse-embeddings"HEADERS = {"Authorization": f"Bearer {os.environ['KURE_API_KEY']}"}query = "νλ―Όμ μμ μΈμ λ§λ€μ΄μ‘λμ?"documents = ["μΈμ’ λμμ 1443λ μ νλ―Όμ μμ μ°½μ νκ³ 1446λ μ μ΄λ₯Ό λ°ν¬νμλ€.","κΉμΉλ λ°°μΆλ 무λ₯Ό μκΈμ μ μΈ λ€ κ³ μΆ§κ°λ£¨μ μ κ°μ λ£μ΄ λ°ν¨μν¨ μμμ΄λ€.","νλΌμ°μ ν΄λ° 1,947mλ‘ λ¨νμμ κ°μ₯ λμ μ°μ΄λ©° μ μ£Όλ μ€μμ μ리νλ€.",]# input_type adds the query or document markers. return_tokens=True also returns the term of each indexdef encode(texts, input_type):response = requests.post(URL, headers=HEADERS, json={"model": "kure-sparse-nano", "input": texts, "input_type": input_type})response.raise_for_status()return [dict(zip(e["indices"], e["values"])) for e in response.json()["data"]]query_embedding = encode(query, "query")[0]document_embeddings = encode(documents, "document")# Dot-product scores (higher is more relevant)scores = [sum(w * doc.get(i, 0.0) for i, w in query_embedding.items()) for doc in document_embeddings]print([round(s, 4) for s in scores])# [117.3682, 11.7437, 6.2175]```## EvaluationKURE-Sparse-nano is evaluated on the nine **MTEB(kor, v2) Retrieval** tasks. We report nDCG@10.
README.md+37