Text Classification
Scikit-learn
English
agriculture
logistic-regression
tfidf
binary-classification
crop-health
Instructions to use PopeJohn/agriculture-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use PopeJohn/agriculture-model with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("PopeJohn/agriculture-model", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
π± Agriculture Text Classifier
Model owner: PopeJohn
Repository: PopeJohn/agriculture-model
π Overview
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.
π Files in this repository
agriculture_model.pklβ Trained Logistic Regression modelvectorizer.pklβ Fitted TFβIDF vectorizer for text preprocessing
π Intended Use
This model is designed for:
- Classifying farmer questions into crop/disease categories
- Indexing or tagging agricultural content
- Supporting NLP pipelines in agriculture-focused applications
Not intended for:
- Real-time critical decision-making without human verification
- Non-agriculture domains without fine-tuning
βοΈ How to Use
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])
- Downloads last month
- -