Internal-LinkLM

A fine-tuned Cross-Encoder Reranker based on BAAI/bge-reranker-large for semantic document ranking and internal link recommendation.

This model was fine-tuned to score the relevance between a query and a candidate document. It is designed for retrieval and reranking tasks such as:

  • Internal Link Recommendation
  • Semantic Search
  • Information Retrieval
  • Document Ranking
  • Search Result Reranking

Base Model

  • BAAI/bge-reranker-large
  • Architecture: XLM-RoBERTa Cross Encoder

Training

The model was fine-tuned using the Hugging Face Transformers Trainer.

Training configuration:

  • Epochs: 3
  • Framework: PyTorch
  • Library: Transformers
  • Loss: Cross-Entropy Loss
  • Optimizer: AdamW

Evaluation

Metric Score
Accuracy 0.8476
Precision 0.6279
Recall 0.5841
F1 Score 0.6052

Usage

from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained(
    "NayonAhmed09/internal-linklm"
)

model = AutoModelForSequenceClassification.from_pretrained(
    "NayonAhmed09/internal-linklm"
)

Example:

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

tokenizer = AutoTokenizer.from_pretrained(
    "NayonAhmed09/internal-linklm"
)

model = AutoModelForSequenceClassification.from_pretrained(
    "NayonAhmed09/internal-linklm"
)

query = "Best moisturizer for oily skin"
document = "A complete guide to choosing skincare products for oily skin."

inputs = tokenizer(
    query,
    document,
    return_tensors="pt",
    truncation=True,
    max_length=512
)

with torch.no_grad():
    score = model(**inputs).logits.squeeze().item()

print(score)

Higher scores indicate higher semantic relevance.


Files

  • model.safetensors
  • config.json
  • tokenizer.json
  • tokenizer_config.json
  • training_args.bin

License

MIT License


Author

Nayon Ahmed

GitHub: https://github.com/nayonahmedjoy

Hugging Face: https://huggingface.co/NayonAhmed09

Downloads last month
5
Safetensors
Model size
0.6B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for NayonAhmed09/internal-linklm

Finetuned
(10)
this model