Text Classification
Transformers
Safetensors
distilbert
Generated from Trainer
text-embeddings-inference
Instructions to use ContextNews/news-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ContextNews/news-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ContextNews/news-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("ContextNews/news-classifier") model = AutoModelForSequenceClassification.from_pretrained("ContextNews/news-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from ContextNews/news-classifier: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/ContextNews/news-classifier/resolve/main/config.json
- Command line
-
hf download hf://ContextNews/news-classifier/config.json
-
curl -L -o config.json https://huggingface.co/ContextNews/news-classifier/resolve/main/config.json
1.35 kB
| { | |
| "activation": "gelu", | |
| "architectures": [ | |
| "DistilBertForSequenceClassification" | |
| ], | |
| "attention_dropout": 0.1, | |
| "bos_token_id": null, | |
| "dim": 768, | |
| "dropout": 0.1, | |
| "dtype": "float32", | |
| "eos_token_id": null, | |
| "hidden_dim": 3072, | |
| "id2label": { | |
| "0": "politics", | |
| "1": "geopolitics", | |
| "2": "conflict", | |
| "3": "crime", | |
| "4": "law", | |
| "5": "business", | |
| "6": "economy", | |
| "7": "markets", | |
| "8": "technology", | |
| "9": "science", | |
| "10": "health", | |
| "11": "environment", | |
| "12": "society", | |
| "13": "education", | |
| "14": "sports", | |
| "15": "entertainment" | |
| }, | |
| "initializer_range": 0.02, | |
| "label2id": { | |
| "business": 5, | |
| "conflict": 2, | |
| "crime": 3, | |
| "economy": 6, | |
| "education": 13, | |
| "entertainment": 15, | |
| "environment": 11, | |
| "geopolitics": 1, | |
| "health": 10, | |
| "law": 4, | |
| "markets": 7, | |
| "politics": 0, | |
| "science": 9, | |
| "society": 12, | |
| "sports": 14, | |
| "technology": 8 | |
| }, | |
| "max_position_embeddings": 512, | |
| "model_type": "distilbert", | |
| "n_heads": 12, | |
| "n_layers": 6, | |
| "pad_token_id": 0, | |
| "problem_type": "multi_label_classification", | |
| "qa_dropout": 0.1, | |
| "seq_classif_dropout": 0.2, | |
| "sinusoidal_pos_embds": false, | |
| "tie_weights_": true, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "5.0.0", | |
| "use_cache": false, | |
| "vocab_size": 30522 | |
| } | |