Text Classification
Transformers
English
sentence-pruning
highlighting
rag
regulatory
stablecoin
context-compression
bge-reranker
Eval Results (legacy)
Instructions to use sugiv/stablebridge-pruner-highlighter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sugiv/stablebridge-pruner-highlighter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="sugiv/stablebridge-pruner-highlighter")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sugiv/stablebridge-pruner-highlighter", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add library requirements and UNEXPECTED/MISSING key explanations
Browse files
README.md
CHANGED
|
@@ -122,8 +122,31 @@ highlight_indices = [i for i, score in enumerate(scores) if score >= 0.9]
|
|
| 122 |
### Installation
|
| 123 |
|
| 124 |
```bash
|
| 125 |
-
pip install
|
| 126 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
|
| 128 |
### Quick Start
|
| 129 |
|
|
|
|
| 122 |
### Installation
|
| 123 |
|
| 124 |
```bash
|
| 125 |
+
pip install "transformers>=4.41" "huggingface_hub>=0.27" torch
|
| 126 |
```
|
| 127 |
+
> **Important:** Requires `huggingface_hub >= 0.27` to avoid deprecated API errors.
|
| 128 |
+
|
| 129 |
+
### Requirements
|
| 130 |
+
|
| 131 |
+
| Library | Minimum Version | Notes |
|
| 132 |
+
|---------|----------------|-------|
|
| 133 |
+
| `transformers` | **>= 4.41** | XLMRobertaModel support |
|
| 134 |
+
| `huggingface_hub` | **>= 0.27** | No deprecated `use_auth_token` |
|
| 135 |
+
| `torch` | **>= 2.0** | CUDA support |
|
| 136 |
+
|
| 137 |
+
```bash
|
| 138 |
+
pip install "transformers>=4.41" "huggingface_hub>=0.27" torch
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
### Loading Notes
|
| 142 |
+
|
| 143 |
+
**UNEXPECTED / MISSING keys on load:** When loading `AutoModel.from_pretrained("BAAI/bge-reranker-v2-m3")`, you will see warnings about:
|
| 144 |
+
|
| 145 |
+
- **UNEXPECTED** keys (`classifier.out_proj.weight`, `classifier.out_proj.bias`, `classifier.dense.weight`, `classifier.dense.bias`): These are the **reranker's classification head** weights. Since we load with `AutoModel` (encoder-only, no classification head), these extra keys are not consumed. This is **completely normal** — we only need the encoder backbone. Our separate `PruningHead` MLP replaces the original classification head.
|
| 146 |
+
|
| 147 |
+
- **MISSING** keys (`pooler.dense.weight`, `pooler.dense.bias`): The `AutoModel` class expects a pooler layer, but the BGE-reranker checkpoint was trained without one. These get **randomly initialized** but are **never used** in our pipeline — we use `last_hidden_state` directly, not the pooled output. Safe to ignore.
|
| 148 |
+
|
| 149 |
+
|
| 150 |
|
| 151 |
### Quick Start
|
| 152 |
|