Sentence Similarity
sentence-transformers
Safetensors
English
mpnet
text2sql
schema-linking
aap-sql
text-embeddings-inference
Instructions to use TommyPanLab/AAP-SQL-E2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use TommyPanLab/AAP-SQL-E2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("TommyPanLab/AAP-SQL-E2") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
File size: 1,805 Bytes
b0b98a3 | 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 | ---
language:
- en
library_name: sentence-transformers
pipeline_tag: sentence-similarity
base_model: sentence-transformers/all-mpnet-base-v2
tags:
- sentence-transformers
- text2sql
- schema-linking
- aap-sql
---
# AAP-SQL E2 column retriever
AAP-SQL E2 是完整 AAP-SQL 設定中的雙編碼欄位檢索器。它先從資料庫 schema 中取回 50 個候選欄位,再交給 R1 cross-encoder 重排。
AAP-SQL E2 is the bi-encoder column retriever used by the full AAP-SQL configuration. It retrieves 50 schema-column candidates before the R1 cross-encoder reranks them.
## Model details
- Base model: `sentence-transformers/all-mpnet-base-v2`
- Training objective: `MultipleNegativesRankingLoss`
- Training seed: `42`
- Training data: column-retrieval examples derived from the BIRD training split and schema descriptions
- Expected library: `sentence-transformers>=5.1.2`
## Use with AAP-SQL
Download this repository into the path expected by the final runner:
```powershell
hf download TommyPanLab/AAP-SQL-E2 --local-dir models/column_retriever_v3_paper_earlystop
```
Direct loading:
```python
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("TommyPanLab/AAP-SQL-E2")
embeddings = model.encode(["table.column: column description"])
```
The complete pipeline, required BIRD directory layout, and Gemini 3.1 result are documented in the [AAP-SQL publication branch](https://github.com/Tommyweige/AAP-SQL/tree/codex/final-aap-sql-experiment/AAP-SQL-Original).
## Data and license notice
The training examples were derived from the BIRD benchmark. Review the [BIRD project terms](https://bird-bench.github.io/) before using the model. No additional license has been declared for these fine-tuned weights; the upstream model and dataset terms still apply.
|