Sentence Similarity
sentence-transformers
Safetensors
English
mpnet
text2sql
schema-linking
aap-sql
text-embeddings-inference
Instructions to use TommyPanLab/AAP-SQL-Column-Retriever with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use TommyPanLab/AAP-SQL-Column-Retriever with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("TommyPanLab/AAP-SQL-Column-Retriever") 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,939 Bytes
b0b98a3 ec6075a b0b98a3 ec6075a b0b98a3 ec6075a b0b98a3 ec6075a b0b98a3 ec6075a b0b98a3 ec6075a b0b98a3 ec6075a b0b98a3 ec6075a b0b98a3 ec6075a b0b98a3 ec6075a | 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 | ---
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 column retriever
AAP-SQL 欄位檢索器是完整 AAP-SQL 設定中的雙編碼模型。它從完整資料庫結構與欄位描述中召回最多 50 個候選欄位,供後續重排序器選出核心欄位。
AAP-SQL column retriever is the bi-encoder used in the full AAP-SQL workflow. It performs the first stage of schema retrieval and returns up to 50 candidate columns for candidate reranking.
## 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
## AAP-SQL publication branch
The complete AAP-SQL workflow, research method terminology, BIRD directory layout, and reproduction instructions are maintained in the [GitHub publication branch](https://github.com/Tommyweige/AAP-SQL/tree/codex/final-aap-sql-experiment/AAP-SQL-Original).
## Use with AAP-SQL
Download this repository into the path expected by the final runner:
~~~powershell
hf download TommyPanLab/AAP-SQL-Column-Retriever --local-dir models/column_retriever_v3_paper_earlystop
~~~
Direct loading:
~~~python
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("TommyPanLab/AAP-SQL-Column-Retriever")
embeddings = model.encode(["table.column: column description"])
~~~
## 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. |