Improve model card with metadata and description
Browse filesThis PR improves the model card by:
- Adding the `pipeline_tag: text-classification` to indicate its use in text classification preprocessing.
- Specifying the `library_name: fasttext` as it's a fastText-based filter.
- Confirming the `license: mit`.
- Providing a more descriptive model card.
This makes the model and its purpose clearer to users.
README.md
CHANGED
|
@@ -1,6 +1,25 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
-
|
| 5 |
-
the PIQA task, discussed in the main text of the Perplexity
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
pipeline_tag: text-classification
|
| 4 |
+
library_name: fasttext
|
| 5 |
---
|
| 6 |
+
|
| 7 |
+
This is the fastText pretraining data filter targeting the PIQA task, discussed in the main text of the Perplexity Correlations paper: https://arxiv.org/abs/2409.05816. This filter helps select high-quality pretraining data by identifying strong correlations between LLM perplexity on a given text and its downstream performance on a target benchmark (PIQA in this case). The filter is trained using perplexity correlations from a sample of 90 LLMs from the Open LLM Leaderboard on texts from tens of thousands of web domains.
|
| 8 |
+
|
| 9 |
+
The filter is implemented using the `fasttext` library and can be used to select or weight pretraining data samples based on their predicted likelihood of improving downstream performance.
|
| 10 |
+
|
| 11 |
+
For more information on the methodology and usage, please refer to the [Perplexity Correlations paper](https://arxiv.org/abs/2409.05816) and the [project repository](https://github.com/TristanThrush/perplexity-correlations).
|
| 12 |
+
|
| 13 |
+
```python
|
| 14 |
+
import fasttext
|
| 15 |
+
|
| 16 |
+
# Load the pre-trained fastText model
|
| 17 |
+
model = fasttext.load_model('fasttext_filter.bin')
|
| 18 |
+
|
| 19 |
+
# Example usage: Get the 'include' probability for a piece of text
|
| 20 |
+
text = "Some text to filter."
|
| 21 |
+
prediction = model.predict(text)[0] # Prediction is 'include' or 'exclude'
|
| 22 |
+
probability = model.predict_proba(text)[0][0] if prediction[0] == '__label__include' else model.predict_proba(text)[0][1] # probability of 'include'
|
| 23 |
+
|
| 24 |
+
print(f"Prediction: {prediction[0]}, Probability: {probability}")
|
| 25 |
+
```
|