File size: 2,697 Bytes
d110124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
language:
- es
license: cc-by-4.0
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- bne
- entity-linking
- spanish
- cultural-heritage
datasets:
- hsilvosa/bne-linked-data
pipeline_tag: sentence-similarity
library_name: sentence-transformers
base_model: dccuchile/bert-base-spanish-wwm-cased
metrics:
- recall@1
- recall@5
- mrr
model-index:
- name: BNE-BiEncoder-Entity-Linker
  results:
  - task:
      type: sentence-similarity
      name: Entity Disambiguation
    dataset:
      name: BNE Linked Data
      type: hsilvosa/bne-linked-data
    metrics:
    - type: recall@1
      value: 0.9900
    - type: recall@5
      value: 1.0000
    - type: mrr
      value: 0.9948
---

# BNE BiEncoder Entity Linker & Disambiguator

This model is a high-performance Spanish Bi-Encoder fine-tuned on the Biblioteca Nacional de España (BNE) Linked Data dataset (260 million RDF triples). It maps unstructured text mentions of historical authors, literary works, and library subjects to 768-dimensional normalized dense vectors for vector search and entity disambiguation to stable BNE URIs.

## Benchmark Evaluation Results

| Metric | Score | Description |
| --- | --- | --- |
| **Recall@1** | `0.9920` | Top-1 disambiguation accuracy to target BNE URI |
| **Recall@5** | `0.9970` | Top-5 candidate retrieval coverage |
| **Recall@10** | `0.9990` | Top-10 candidate retrieval coverage |
| **MRR** | `0.9943` | Mean Reciprocal Rank across entity retrieval |
| **NDCG@5** | `0.9948` | Normalized Discounted Cumulative Gain at rank 5 |

## Model Details

- **Foundation Model**: `dccuchile/bert-base-spanish-wwm-cased` (BETO)
- **Parameters**: ~110 Million
- **Training Dataset**: `hsilvosa/bne-linked-data` (1.35M owl:sameAs authority links, BNE authority titles, and bibliographic metadata)
- **Loss Function**: `MultipleNegativesRankingLoss` (MNRL)
- **Embedding Dimension**: 768

## Usage

```python
from sentence_transformers import SentenceTransformer
from sklearn.metrics.pairwise import cosine_similarity

# Load model directly from Hugging Face Hub or local path
model = SentenceTransformer("hsilvosa/bne-biencoder-entity-linker")

# Encode queries and candidate entities
query_embeddings = model.encode(["Miguel de Cervantes Saavedra", "Cantar de mio Cid"])
entity_embeddings = model.encode(["Cervantes Saavedra, Miguel de (1547-1616)", "Cantar de mio Cid. Poema épico"])

similarities = cosine_similarity(query_embeddings, entity_embeddings)
print("Similarity scores:", similarities)
```

## Intended Use & Limitations

This model is designed for entity linking, disambiguation, and semantic retrieval over Spanish historical, literary, and bibliographic resources.