agriculture-model / README.md
PopeJohn's picture
Update README.md
3d09ac5 verified
---
license: mit
datasets:
- custom
language:
- en
metrics:
- accuracy
- f1
pipeline_tag: text-classification
library_name: sklearn
tags:
- agriculture
- logistic-regression
- tfidf
- binary-classification
- crop-health
model_name: Agriculture Text Classifier
model_creator: PopeJohn
model_type: sklearn
model_description: A logistic regression classifier trained on agricultural text using TF-IDF features.
---
๐ŸŒฑ Agriculture Text Classifier
**Model owner:** [PopeJohn](https://huggingface.co/PopeJohn)
**Repository:** [PopeJohn/agriculture-model](https://huggingface.co/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 model
- `vectorizer.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
```python
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])