BhabhaAI/DEITA-Complexity
Viewer β’ Updated β’ 72.8k β’ 109 β’ 2
How to use thethinkmachine/MICE with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="thethinkmachine/MICE") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("thethinkmachine/MICE")
model = AutoModelForSequenceClassification.from_pretrained("thethinkmachine/MICE")A fast, efficient, and accurate instruction complexity scorer powered by ModernBERT-Large. MICE predicts normalized task difficulty scores (0β1) for English instructions, with an easy option to rescale to custom ranges.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "thethinkmachine/Maxwell-Task-Complexity-Scorer-v0.2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# 1. Get normalized complexity (0β1)
def get_normalized_score(text: str) -> float:
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits.squeeze()
return float(logits)
# 2. Denormalize to [min_score, max_score]
def get_denormalized_score(text: str, min_score: float = 1, max_score: float = 6) -> float:
norm = get_normalized_score(text)
raw = norm * (max_score - min_score) + min_score
return float(round(raw, 2))
# Example
query = "Is learning equivalent to decreasing local entropy?"
print("Normalized:", get_normalized_score(query))
print("Evol-Complexity [1β6]:", get_denormalized_score(query))
score * (max - min) + min.| Original Score | Count | % |
|---|---|---|
| 1 | 8,729 | 13.3% |
| 2 | 5,399 | 8.2% |
| 3 | 10,937 | 16.7% |
| 4 | 9,801 | 15.0% |
| 5 | 24,485 | 37.4% |
| 6 | 6,123 | 9.3% |
Outliers (0,7β9) were pruned (<1% of data).
If you use MICE in your research, please cite:
Chaubey, S. (2024). Maxwell Instruction Complexity Estimator (MICE). https://huggingface.co/thethinkmachine/MICE
Shreyan C (thethinkmachine) Email: shreyan.chaubey@gmail.com
This project is licensed under the Apache 2.0 License.
Base model
answerdotai/ModernBERT-large