YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
FastText Climate Classifier
FastText supervised classifier trained on newspaper data for climate content detection.
Files
fasttext_climate.bin- Trained FastText modelchunk_labels.jsonl- Training data (220K labeled chunks)fasttext_train.txt- Training filefasttext_valid.txt- Validation filekeywords.txt- Climate/nature keywordsevaluation_metrics.json- Full metricstraining_config.json- Training configuration
Usage
import fasttext
from fasttext.FastText import _FastText as FastTextModel
# NumPy 2.x compatibility patch
def patched_predict(self, text, k=1, threshold=0.0, on_unicode_error='strict'):
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
result = self.f.predict(text, k, threshold, on_unicode_error)
if result:
probs = [float(p) for p, _ in result]
labels = [l for _, l in result]
return tuple(labels), probs
else:
return (), []
FastTextModel.predict = patched_predict
# Load model
model = fasttext.load_model('fasttext_climate.bin')
# Predict
labels, probs = model.predict('carbon emissions and global warming')
print(f'Label: {labels[0]}, Probability: {probs[0]:.4f}')
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
