Text Ranking
sentence-transformers
Safetensors
English
bert
text2sql
schema-linking
aap-sql
text-embeddings-inference
Instructions to use TommyPanLab/AAP-SQL-Candidate-Reranker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use TommyPanLab/AAP-SQL-Candidate-Reranker with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("TommyPanLab/AAP-SQL-Candidate-Reranker") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Notebooks
- Google Colab
- Kaggle
Align model card with AAP-SQL GitHub workflow
Browse files
README.md
CHANGED
|
@@ -12,39 +12,41 @@ tags:
|
|
| 12 |
- aap-sql
|
| 13 |
---
|
| 14 |
|
| 15 |
-
# AAP-SQL
|
| 16 |
|
| 17 |
-
AAP-SQL
|
| 18 |
|
| 19 |
-
AAP-SQL
|
| 20 |
|
| 21 |
## Model details
|
| 22 |
|
| 23 |
-
- Base model:
|
| 24 |
-
- Training objective:
|
| 25 |
-
- Training seed:
|
| 26 |
- Training data: schema-ranking examples derived from the BIRD training split and schema descriptions
|
| 27 |
-
- Expected library:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
## Use with AAP-SQL
|
| 30 |
|
| 31 |
Download this repository into the path expected by the final runner:
|
| 32 |
|
| 33 |
-
|
| 34 |
-
hf download TommyPanLab/AAP-SQL-
|
| 35 |
-
|
| 36 |
|
| 37 |
Direct loading:
|
| 38 |
|
| 39 |
-
|
| 40 |
from sentence_transformers import CrossEncoder
|
| 41 |
|
| 42 |
-
model = CrossEncoder("TommyPanLab/AAP-SQL-
|
| 43 |
-
scores = model.predict([("user question", "table.column: column description")])
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
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).
|
| 47 |
|
| 48 |
## Data and license notice
|
| 49 |
|
| 50 |
-
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.
|
|
|
|
| 12 |
- aap-sql
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# AAP-SQL candidate reranker
|
| 16 |
|
| 17 |
+
AAP-SQL 候選重排序器是完整 AAP-SQL 設定中的 cross-encoder。它對欄位檢索器召回的候選欄位重新評分,保留前 10 個核心欄位供後續提示增強使用。
|
| 18 |
|
| 19 |
+
AAP-SQL candidate reranker is the cross-encoder used after the first stage of schema retrieval. It scores the retrieved candidate columns and retains the top 10 core columns for prompt augmentation.
|
| 20 |
|
| 21 |
## Model details
|
| 22 |
|
| 23 |
+
- Base model: cross-encoder/ms-marco-MiniLM-L6-v2
|
| 24 |
+
- Training objective: BinaryCrossEntropyLoss
|
| 25 |
+
- Training seed: 42
|
| 26 |
- Training data: schema-ranking examples derived from the BIRD training split and schema descriptions
|
| 27 |
+
- Expected library: sentence-transformers>=5.1.2
|
| 28 |
+
|
| 29 |
+
## AAP-SQL publication branch
|
| 30 |
+
|
| 31 |
+
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).
|
| 32 |
|
| 33 |
## Use with AAP-SQL
|
| 34 |
|
| 35 |
Download this repository into the path expected by the final runner:
|
| 36 |
|
| 37 |
+
~~~powershell
|
| 38 |
+
hf download TommyPanLab/AAP-SQL-Candidate-Reranker --local-dir models/cross_encoder_schema_paper_repro
|
| 39 |
+
~~~
|
| 40 |
|
| 41 |
Direct loading:
|
| 42 |
|
| 43 |
+
~~~python
|
| 44 |
from sentence_transformers import CrossEncoder
|
| 45 |
|
| 46 |
+
model = CrossEncoder("TommyPanLab/AAP-SQL-Candidate-Reranker")
|
| 47 |
+
scores = model.predict([ ("user question", "table.column: column description") ])
|
| 48 |
+
~~~
|
|
|
|
|
|
|
| 49 |
|
| 50 |
## Data and license notice
|
| 51 |
|
| 52 |
+
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.
|