Feature Extraction
sentence-transformers
Safetensors
Korean
English
milco
sparse-encoder
sparse
splade
learned-sparse-retrieval
custom_code
Instructions to use nlpai-lab/KURE-Sparse-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use nlpai-lab/KURE-Sparse-base with sentence-transformers:
from sentence_transformers import SparseEncoder model = SparseEncoder("nlpai-lab/KURE-Sparse-base", trust_remote_code=True) 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
Download config.json from nlpai-lab/KURE-Sparse-base: direct link, hf CLI and curl.
- Browser
- Download file 5.35 kB
-
https://huggingface.co/nlpai-lab/KURE-Sparse-base/resolve/main/config.json
- Command line
-
hf download hf://nlpai-lab/KURE-Sparse-base/config.json
-
curl -L -o config.json https://huggingface.co/nlpai-lab/KURE-Sparse-base/resolve/main/config.json
5.35 kB
| { | |
| "architectures": [ | |
| "MILCOModel" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "milco.MILCOConfig", | |
| "AutoModel": "milco.MILCOModel" | |
| }, | |
| "dtype": "bfloat16", | |
| "en_hidden_size": 768, | |
| "en_sub_config": { | |
| "_name_or_path": "naver/splade-v3", | |
| "add_cross_attention": false, | |
| "architectures": [ | |
| "BertForMaskedLM" | |
| ], | |
| "attention_probs_dropout_prob": 0.1, | |
| "bad_words_ids": null, | |
| "begin_suppress_tokens": null, | |
| "bos_token_id": null, | |
| "chunk_size_feed_forward": 0, | |
| "classifier_dropout": null, | |
| "cross_attention_hidden_size": null, | |
| "decoder_start_token_id": null, | |
| "diversity_penalty": 0.0, | |
| "do_sample": false, | |
| "dtype": "float32", | |
| "early_stopping": false, | |
| "encoder_no_repeat_ngram_size": 0, | |
| "eos_token_id": null, | |
| "exponential_decay_length_penalty": null, | |
| "finetuning_task": null, | |
| "forced_bos_token_id": null, | |
| "forced_eos_token_id": null, | |
| "gradient_checkpointing": false, | |
| "hidden_act": "gelu", | |
| "hidden_dropout_prob": 0.1, | |
| "hidden_size": 768, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 3072, | |
| "is_decoder": false, | |
| "is_encoder_decoder": false, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "layer_norm_eps": 1e-12, | |
| "length_penalty": 1.0, | |
| "max_length": 20, | |
| "max_position_embeddings": 512, | |
| "min_length": 0, | |
| "model_type": "bert", | |
| "no_repeat_ngram_size": 0, | |
| "num_attention_heads": 12, | |
| "num_beam_groups": 1, | |
| "num_beams": 1, | |
| "num_hidden_layers": 12, | |
| "num_return_sequences": 1, | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "output_scores": false, | |
| "pad_token_id": 0, | |
| "position_embedding_type": "absolute", | |
| "prefix": null, | |
| "problem_type": null, | |
| "pruned_heads": {}, | |
| "remove_invalid_values": false, | |
| "repetition_penalty": 1.0, | |
| "return_dict": true, | |
| "return_dict_in_generate": false, | |
| "sep_token_id": null, | |
| "suppress_tokens": null, | |
| "task_specific_params": null, | |
| "temperature": 1.0, | |
| "tf_legacy_loss": false, | |
| "tie_encoder_decoder": false, | |
| "tie_word_embeddings": true, | |
| "tokenizer_class": null, | |
| "top_k": 50, | |
| "top_p": 1.0, | |
| "torchscript": false, | |
| "transformers_version": "4.57.3", | |
| "type_vocab_size": 2, | |
| "typical_p": 1.0, | |
| "use_bfloat16": false, | |
| "use_cache": true, | |
| "vocab_size": 30522 | |
| }, | |
| "en_vocab_size": 30522, | |
| "freeze_embeddings": false, | |
| "lambda_commitment": 0.0, | |
| "lambda_d": 1e-05, | |
| "lambda_q": 0.001, | |
| "lambda_sparsity": 0.0, | |
| "lsr_encoder_checkpoint": "naver/splade-v3", | |
| "m_hidden_size": 1024, | |
| "m_sub_config": { | |
| "_name_or_path": "BAAI/bge-m3-unsupervised", | |
| "add_cross_attention": false, | |
| "architectures": [ | |
| "XLMRobertaModel" | |
| ], | |
| "attention_probs_dropout_prob": 0.1, | |
| "bad_words_ids": null, | |
| "begin_suppress_tokens": null, | |
| "bos_token_id": 0, | |
| "chunk_size_feed_forward": 0, | |
| "classifier_dropout": null, | |
| "cross_attention_hidden_size": null, | |
| "decoder_start_token_id": null, | |
| "diversity_penalty": 0.0, | |
| "do_sample": false, | |
| "dtype": "float32", | |
| "early_stopping": false, | |
| "encoder_no_repeat_ngram_size": 0, | |
| "eos_token_id": 2, | |
| "exponential_decay_length_penalty": null, | |
| "finetuning_task": null, | |
| "forced_bos_token_id": null, | |
| "forced_eos_token_id": null, | |
| "hidden_act": "gelu", | |
| "hidden_dropout_prob": 0.1, | |
| "hidden_size": 1024, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4096, | |
| "is_decoder": false, | |
| "is_encoder_decoder": false, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "layer_norm_eps": 1e-05, | |
| "length_penalty": 1.0, | |
| "max_length": 20, | |
| "max_position_embeddings": 8194, | |
| "min_length": 0, | |
| "model_type": "xlm-roberta", | |
| "no_repeat_ngram_size": 0, | |
| "num_attention_heads": 16, | |
| "num_beam_groups": 1, | |
| "num_beams": 1, | |
| "num_hidden_layers": 24, | |
| "num_return_sequences": 1, | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "output_past": true, | |
| "output_scores": false, | |
| "pad_token_id": 1, | |
| "position_embedding_type": "absolute", | |
| "prefix": null, | |
| "problem_type": null, | |
| "pruned_heads": {}, | |
| "remove_invalid_values": false, | |
| "repetition_penalty": 1.0, | |
| "return_dict": true, | |
| "return_dict_in_generate": false, | |
| "sep_token_id": null, | |
| "suppress_tokens": null, | |
| "task_specific_params": null, | |
| "temperature": 1.0, | |
| "tf_legacy_loss": false, | |
| "tie_encoder_decoder": false, | |
| "tie_word_embeddings": true, | |
| "tokenizer_class": null, | |
| "top_k": 50, | |
| "top_p": 1.0, | |
| "torchscript": false, | |
| "transformers_version": "4.57.3", | |
| "type_vocab_size": 1, | |
| "typical_p": 1.0, | |
| "use_bfloat16": false, | |
| "use_cache": true, | |
| "vocab_size": 250002 | |
| }, | |
| "m_vocab_size": 250002, | |
| "model_type": "milco", | |
| "model_variant": "bert", | |
| "multilingual_encoder_checkpoint": "BAAI/bge-m3-unsupervised", | |
| "only_distillation": true, | |
| "pooling": "2d", | |
| "projector_pretraining": false, | |
| "prompt_length": 0, | |
| "separate_mlp": true, | |
| "softmax_temperature": 1.0, | |
| "sparse_reg": "l1", | |
| "transformers_version": "5.14.1", | |
| "use_2d_mlp": true, | |
| "use_cross_device_negatives": false | |
| } | |