Update README.md
Browse files
README.md
CHANGED
|
@@ -3,114 +3,137 @@ library_name: transformers
|
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: answerdotai/ModernBERT-base
|
| 5 |
tags:
|
| 6 |
-
-
|
|
|
|
| 7 |
datasets:
|
| 8 |
-
- davanstrien/reasoning-
|
| 9 |
language:
|
| 10 |
- en
|
| 11 |
-
|
| 12 |
-
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
<img src="https://cdn-uploads.huggingface.co/production/uploads/60107b385ac3e86b3ea4fc34/vqCMlr4g95ysSAZ2eAn7D.png" alt="ModernBERT-based
|
| 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 |
-
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: answerdotai/ModernBERT-base
|
| 5 |
tags:
|
| 6 |
+
- reasoning
|
| 7 |
+
- reasoning-datasets-competition
|
| 8 |
datasets:
|
| 9 |
+
- davanstrien/natural-reasoning-classifier
|
| 10 |
language:
|
| 11 |
- en
|
| 12 |
+
metrics:
|
| 13 |
+
- mse
|
| 14 |
+
- mae
|
| 15 |
+
- spearman
|
| 16 |
+
widget:
|
| 17 |
+
- text: >-
|
| 18 |
+
The debate on artificial intelligence's role in society has become
|
| 19 |
+
increasingly polarized. Some argue that AI will lead to widespread
|
| 20 |
+
unemployment and concentration of power, while others contend it will create
|
| 21 |
+
new jobs and democratize access to knowledge. These viewpoints reflect
|
| 22 |
+
different assumptions about technological development, economic systems, and
|
| 23 |
+
human adaptability.
|
| 24 |
---
|
| 25 |
|
| 26 |
+
# ModernBERT Reasoning Complexity Regressor
|
| 27 |
+
|
| 28 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/60107b385ac3e86b3ea4fc34/vqCMlr4g95ysSAZ2eAn7D.png" alt="ModernBERT-based Reasoning Complexity Regressor" width=500px>
|
| 29 |
+
|
| 30 |
+
## Model Description
|
| 31 |
+
|
| 32 |
+
This model predicts the reasoning complexity level (0-4) required to engage with a given text. It's fine-tuned from [answerdotai/ModernBERT-base](https://huggingface.co/answerdotai/ModernBERT-base) on the [davanstrien/natural-reasoning-classifier](https://huggingface.co/datasets/davanstrien/natural-reasoning-classifier) dataset.
|
| 33 |
+
|
| 34 |
+
The reasoning complexity scale ranges from:
|
| 35 |
+
|
| 36 |
+
- **0: Minimal Reasoning** - Simple factual content requiring only recall
|
| 37 |
+
- **1: Basic Reasoning** - Straightforward connections or single-step logical processes
|
| 38 |
+
- **2: Intermediate Reasoning** - Integration of multiple factors or perspectives
|
| 39 |
+
- **3: Advanced Reasoning** - Sophisticated analysis across multiple dimensions
|
| 40 |
+
- **4: Expert Reasoning** - Theoretical frameworks and novel conceptual synthesis
|
| 41 |
+
|
| 42 |
+
## Performance
|
| 43 |
+
|
| 44 |
+
The model achieves the following results on the evaluation set:
|
| 45 |
+
|
| 46 |
+
- MSE: 0.2034
|
| 47 |
+
- MAE: 0.2578
|
| 48 |
+
- Spearman Correlation: 0.6963
|
| 49 |
+
|
| 50 |
+
## Intended Uses
|
| 51 |
+
|
| 52 |
+
This model can be used to:
|
| 53 |
+
|
| 54 |
+
- Filter and classify educational content by reasoning complexity
|
| 55 |
+
- Identify complex reasoning problems across diverse domains
|
| 56 |
+
- Serve as a first-stage filter in a reasoning dataset creation pipeline
|
| 57 |
+
|
| 58 |
+
## Limitations
|
| 59 |
+
|
| 60 |
+
- Predictions are influenced by the original dataset's domain distribution
|
| 61 |
+
- Reasoning complexity is subjective and context-dependent
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
## Training
|
| 65 |
+
|
| 66 |
+
The model was fine-tuned using a regression objective with the following settings:
|
| 67 |
+
- Learning rate: 5e-05
|
| 68 |
+
- Batch size: 16
|
| 69 |
+
- Optimizer: AdamW
|
| 70 |
+
- Schedule: Linear
|
| 71 |
+
- Epochs: 10
|
| 72 |
+
|
| 73 |
+
## Usage Examples
|
| 74 |
+
|
| 75 |
+
### Using the pipeline API
|
| 76 |
+
|
| 77 |
+
```python
|
| 78 |
+
from transformers import pipeline
|
| 79 |
+
pipe = pipeline("text-classification", model="davanstrien/ModernBERT-based-Reasoning-Required")
|
| 80 |
+
|
| 81 |
+
def predict_reasoning_level(text, pipe):
|
| 82 |
+
# Get the raw prediction
|
| 83 |
+
result = pipe(text)
|
| 84 |
+
score = result[0]['score']
|
| 85 |
+
|
| 86 |
+
# Round to nearest integer (optional)
|
| 87 |
+
rounded_score = round(score)
|
| 88 |
+
|
| 89 |
+
# Clip to valid range (0-4)
|
| 90 |
+
rounded_score = max(0, min(4, rounded_score))
|
| 91 |
+
|
| 92 |
+
# Create a human-readable interpretation (optional)
|
| 93 |
+
reasoning_labels = {
|
| 94 |
+
0: "No reasoning",
|
| 95 |
+
1: "Basic reasoning",
|
| 96 |
+
2: "Moderate reasoning",
|
| 97 |
+
3: "Strong reasoning",
|
| 98 |
+
4: "Advanced reasoning"
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
return {
|
| 102 |
+
"raw_score": score,
|
| 103 |
+
"reasoning_level": rounded_score,
|
| 104 |
+
"interpretation": reasoning_labels[rounded_score]
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
# Usage
|
| 108 |
+
text = "This argument uses multiple sources and evaluates competing perspectives before reaching a conclusion."
|
| 109 |
+
result = predict_reasoning_level(text, pipe)
|
| 110 |
+
print(f"Raw score: {result['raw_score']:.2f}")
|
| 111 |
+
print(f"Reasoning level: {result['reasoning_level']}")
|
| 112 |
+
print(f"Interpretation: {result['interpretation']}")
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
### Using the model directly
|
| 116 |
+
|
| 117 |
+
```python
|
| 118 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 119 |
+
import torch
|
| 120 |
+
|
| 121 |
+
# Load model and tokenizer
|
| 122 |
+
model_name = "davanstrien/modernbert-reasoning-complexity"
|
| 123 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
| 124 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 125 |
+
|
| 126 |
+
# Prepare text
|
| 127 |
+
text = "The debate on artificial intelligence's role in society has become increasingly polarized."
|
| 128 |
+
|
| 129 |
+
# Tokenize and predict
|
| 130 |
+
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
|
| 131 |
+
with torch.no_grad():
|
| 132 |
+
outputs = model(**inputs)
|
| 133 |
+
|
| 134 |
+
# Get regression score
|
| 135 |
+
complexity_score = outputs.logits.item()
|
| 136 |
+
print(f"Reasoning Complexity: {complexity_score:.2f}/4.00")
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
|