Instructions to use Freakdivi/Task_Classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Freakdivi/Task_Classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Freakdivi/Task_Classifier")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Freakdivi/Task_Classifier", device_map="auto") - Scikit-learn
How to use Freakdivi/Task_Classifier with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("Freakdivi/Task_Classifier", "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
| library_name: transformers | |
| tags: | |
| - text-classification | |
| - bert | |
| - query-routing | |
| - sklearn | |
| - mlp | |
| license: unknown | |
| language: | |
| - en | |
| pipeline_tag: text-classification | |
| # Freakdivi β BERT Query Router | |
| ## Model Description | |
| A BERT-based sequence classification model that routes natural-language queries into predefined categories. | |
| The model encodes each query with **bert-base-uncased** and feeds the `[CLS]` embedding to a scikit-learn MLP classifier. | |
| This repository contains: | |
| - `mlp_query_classifier.joblib` β trained MLP classifier | |
| - `scaler_query_classifier.joblib` β feature scaler used on BERT embeddings | |
| - `label_encoder_query_classifier.joblib` β maps class indices β string labels | |
| - `inference.py` β handler used by Hugging Face Inference Endpoints | |
| > β οΈ **TODO:** Replace the task + label descriptions below with your actual ones. | |
| --- | |
| ## Task | |
| **Multi-class text classification / query routing** | |
| Given an input query, the model predicts one of *N* categories, such as: | |
| | ID | Label | Description | | |
| |----|--------------|------------------------------------------| | |
| | 0 | `LABEL_0` π | *TODO: short description of label 0* | | |
| | 1 | `LABEL_1` π | *TODO: short description of label 1* | | |
| | 2 | `LABEL_2` π | *TODO: short description of label 2* | | |
| | 3 | `LABEL_3` π | *TODO: add/remove rows as needed* | | |
| You can get the exact list of labels by checking the `label_encoder_query_classifier.joblib` in code: | |
| ``` |