Qwen-Vietnamese-Slang-Finetuned

This is a Cross Encoder model finetuned from Qwen/Qwen3-Reranker-0.6B using the sentence-transformers library. It computes scores for pairs of texts, which can be used for text reranking and semantic search.

Model Details

Model Description

  • Model Type: Cross Encoder
  • Base model: Qwen/Qwen3-Reranker-0.6B
  • Maximum Sequence Length: 40960 tokens
  • Number of Output Labels: 1 label
  • Supported Modalities: Text, Message
  • Language: vi
  • License: apache-2.0

Model Sources

Full Model Architecture

CrossEncoder(
  (0): Transformer({'transformer_task': 'text-generation', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'logits'}, 'message': {'method': 'forward', 'method_output_name': 'logits', 'format': 'flat'}}, 'module_output_name': 'causal_logits', 'architecture': 'Qwen3ForCausalLM'})
  (1): LogitScore({'true_token_id': 9693, 'false_token_id': 2152, 'module_input_name': 'causal_logits'})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference.

from sentence_transformers import CrossEncoder

# Download from the 🤗 Hub
model = CrossEncoder("istt-aiml-data/Criminal-Qwen3-Reranker-0.6Bov")
# Get scores for pairs of inputs
pairs = [
    ['nghe bảo bên đức lúc trước em ở thì mua coca thì có mà bán nhà để chơi kk', 'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.'],
    ['Mà bên mỹ hay chơi coca mà', 'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.'],
    ['Shop hệ ke kẹo nc vui molly coca', 'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.'],
    ['Coca chơi nó vẫn sẽ oke hơn ke', 'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.'],
    ['Coca thấy bảo đứng đầu vì nguồn gốc tự nhiên với nó feee hơn à bùm', 'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.'],
]
scores = model.predict(pairs)
print(scores)
# [13.25   13.1875 13.25   13.75   13.625 ]

# Or rank different texts based on similarity to a single text
ranks = model.rank(
    'nghe bảo bên đức lúc trước em ở thì mua coca thì có mà bán nhà để chơi kk',
    [
        'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.',
        'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.',
        'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.',
        'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.',
        'Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương.',
    ]
)
# [{'corpus_id': ..., 'score': ...}, {'corpus_id': ..., 'score': ...}, ...]

Training Details

Training Dataset

Unnamed Dataset

  • Size: 374 training samples
  • Columns: query, passage, and label
  • Approximate statistics based on the first 100 samples:
    query passage label
    type string string float
    modality text text
    details
    • min: 73 tokens
    • mean: 73.0 tokens
    • max: 73 tokens
    • min: 73 tokens
    • mean: 73.0 tokens
    • max: 73 tokens
    • min: 1.0
    • mean: 1.0
    • max: 1.0
  • Samples:
    query passage label
    nghe bảo bên đức lúc trước em ở thì mua coca thì có mà bán nhà để chơi kk Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương. 1.0
    Mà bên mỹ hay chơi coca mà Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương. 1.0
    Shop hệ ke kẹo nc vui molly coca Trong ngữ cảnh này, "coca" chỉ cocaine, một loại ma túy gây nghiện kích thích hệ thần kinh trung ương. 1.0
  • Loss: BinaryCrossEntropyLoss with these parameters:
    {
        "activation_fn": "torch.nn.modules.linear.Identity",
        "pos_weight": null
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • num_train_epochs: 5
  • learning_rate: 2e-05
  • lr_scheduler_type: cosine
  • weight_decay: 0.01
  • gradient_accumulation_steps: 2

All Hyperparameters

Click to expand
  • per_device_train_batch_size: 8
  • num_train_epochs: 5
  • max_steps: -1
  • learning_rate: 2e-05
  • lr_scheduler_type: cosine
  • lr_scheduler_kwargs: None
  • warmup_steps: 0
  • optim: adamw_torch_fused
  • optim_args: None
  • weight_decay: 0.01
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • optim_target_modules: None
  • gradient_accumulation_steps: 2
  • average_tokens_across_devices: True
  • max_grad_norm: 1.0
  • label_smoothing_factor: 0.0
  • bf16: False
  • fp16: False
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • use_liger_kernel: False
  • liger_kernel_config: None
  • use_cache: False
  • neftune_noise_alpha: None
  • torch_empty_cache_steps: None
  • auto_find_batch_size: False
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • include_num_input_tokens_seen: no
  • log_level: passive
  • log_level_replica: warning
  • disable_tqdm: False
  • project: huggingface
  • trackio_space_id: None
  • trackio_bucket_id: None
  • trackio_static_space_id: None
  • per_device_eval_batch_size: 8
  • prediction_loss_only: True
  • eval_on_start: False
  • eval_do_concat_batches: True
  • eval_use_gather_object: False
  • eval_accumulation_steps: None
  • include_for_metrics: []
  • batch_eval_metrics: False
  • save_only_model: False
  • save_on_each_node: False
  • enable_jit_checkpoint: False
  • push_to_hub: False
  • hub_private_repo: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_always_push: False
  • hub_revision: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • restore_callback_states_from_checkpoint: False
  • full_determinism: False
  • seed: 42
  • data_seed: None
  • use_cpu: False
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • parallelism_config: None
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • dataloader_prefetch_factor: None
  • remove_unused_columns: True
  • label_names: None
  • train_sampling_strategy: random
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • ddp_static_graph: None
  • ddp_backend: None
  • ddp_timeout: 1800
  • fsdp: None
  • fsdp_config: None
  • deepspeed: None
  • debug: []
  • skip_memory_metrics: True
  • do_predict: False
  • resume_from_checkpoint: None
  • warmup_ratio: None
  • local_rank: -1
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

Training Logs

Epoch Step Training Loss
0.4255 10 0.2362
0.8511 20 0.0000
1.2553 30 0.0000
1.6809 40 0.0000
2.0851 50 0.0000
2.5106 60 0.0000
2.9362 70 0.0000
3.3404 80 0.0000
3.7660 90 0.0000
4.1702 100 0.0000
4.5957 110 0.0000
5.0 120 0.0000

Training Time

  • Training: 5.8 minutes

Framework Versions

  • Python: 3.12.13
  • Sentence Transformers: 5.7.0
  • Transformers: 5.13.1
  • PyTorch: 2.11.0+cu128
  • Accelerate: 1.14.0
  • Datasets: 4.0.0
  • Tokenizers: 0.22.2

Additional Resources

Citation

BibTeX

Sentence Transformers

@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}
Downloads last month
55
Safetensors
Model size
0.6B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for istt-aiml-data/Criminal-Qwen3-Reranker-0.6Bov

Finetuned
(31)
this model

Paper for istt-aiml-data/Criminal-Qwen3-Reranker-0.6Bov