Downloads · 30 days
0
Tianqin-Meng/fasttext-climate-classifier
fasttext-climate-classifier is a machine learning model from Tianqin-Meng. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
FastText supervised classifier trained on newspaper data for climate content detection.
Downloads · 30 days
0
Access
Public
Updated Feb 14, 2026
Repo size
5.6 GB
Likes
0
Public
Click a slice to open those files.
.bin4.1 GB · 74%
From the Hugging Face model README
FastText supervised classifier trained on newspaper data for climate content detection.

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 configurationimport 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}')