File size: 1,886 Bytes
795547d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: agpl-3.0
pipeline_tag: feature-extraction
language:
- en
tags:
- sentence-embeddings
- sentence-similarity
- splinet
- torchscript
---

# SpliNet Embedder

Sentence-embedding version of SpliNet.

The complete encoder was fine-tuned end-to-end on **134,378 positive QQP duplicate pairs** using symmetric contrastive learning.

## Model

| Property | Value |
|---|---:|
| Encoder parameters | **82,270,464** |
| Embedding dimension | **768** |
| Maximum input length | **512 tokens** |
| Pooling | Masked mean |
| Output | L2-normalized |
| Fine-tuning pairs | **134,378** |
| Epochs | **1** |
| Optimization steps | **8,958** |

## Full evaluation

| Benchmark | Metric | Score |
|---|---|---:|
| STSBenchmark | Pearson | **0.5257** |
| STSBenchmark | Spearman | **0.5174** |
| SciFact | nDCG@10 | **0.1928** |
| SciFact | MAP@10 | **0.1686** |
| SciFact | MRR@10 | **0.1766** |
| SciFact | Recall@10 | **0.2614** |
| SciFact | Recall@100 | **0.4413** |
| Twenty Newsgroups | Mean V-measure | **0.1532** |
| Twenty Newsgroups | Mean homogeneity | **0.1510** |
| Twenty Newsgroups | Mean completeness | **0.1555** |

Twenty Newsgroups evaluation used **59,545 texts** across all ten subsets.

## Files

- `splinet_embedder.ts` — complete deployable TorchScript encoder
- `splinet_embedder_full_qqp.pt` — original trained checkpoint
- `spiece.model` — tokenizer
- `api.py` — Python/FastAPI interface
- `model_info.json` — metadata
- `evaluation/` — benchmark results
- `training/` — final training metadata

## Usage

Install `requirements.txt`, then:

    from api import encode, similarity
    z = encode(['first sentence', 'second sentence'])
    print(z.shape)

To serve:

    python api.py

Endpoints: `/health`, `/model-info`, `/embed`, `/similarity`.

Base model: https://huggingface.co/Angshul/SpliNet

Source: https://github.com/AngshulMajumdar/SpliNet