Downloads · 30 days
0
PopeJohn/agriculture-model
agriculture-model is a text classification model from PopeJohn. Use it when you need a label for a piece of text. It is set up for sklearn. The card lists the license as mit.
Downloads · 30 days
0
Access
Public
Updated Aug 18, 2025
Repo size
2.9 KB
Likes
0
Public
Click a slice to open those files.
.pkl5.9 KB · 53%
From the Hugging Face model README
🌱 Agriculture Text Classifier
Model owner: PopeJohn
Repository: PopeJohn/agriculture-model
This model is a Logistic Regression classifier trained on agricultural text data, using TF–IDF vectorization for feature extraction.
It predicts predefined agriculture-related categories from short text inputs, making it useful for tasks like farmer query routing, agronomic content tagging, and agricultural market analysis.
agriculture_model.pkl — Trained Logistic Regression modelvectorizer.pkl — Fitted TF–IDF vectorizer for text preprocessingThis model is designed for:
Not intended for:
from huggingface_hub import hf_hub_download
import joblib
# Download files from Hugging Face Hub
model_path = hf_hub_download("PopeJohn/agriculture-model", "agriculture_model.pkl")
vectorizer_path = hf_hub_download("PopeJohn/agriculture-model", "vectorizer.pkl")
# Load
model = joblib.load(model_path)
vectorizer = joblib.load(vectorizer_path)
# Predict
sample_text = ["Healthy maize crop after seasonal rains"]
prediction = model.predict(vectorizer.transform(sample_text))
print(prediction[0])