Run this model with HF Jobs
Run BEE-spoke-data/albert-xxlarge-v2-description2genre on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/BEE-spoke-data/albert-xxlarge-v2-description2genre. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/BEE-spoke-data/albert-xxlarge-v2-description2genre on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use BEE-spoke-data/albert-xxlarge-v2-description2genre with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BEE-spoke-data/albert-xxlarge-v2-description2genre with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="BEE-spoke-data/albert-xxlarge-v2-description2genre")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("BEE-spoke-data/albert-xxlarge-v2-description2genre") model = AutoModelForSequenceClassification.from_pretrained("BEE-spoke-data/albert-xxlarge-v2-description2genre", device_map="auto") - Notebooks
- Google Colab
- Kaggle
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("BEE-spoke-data/albert-xxlarge-v2-description2genre")
model = AutoModelForSequenceClassification.from_pretrained("BEE-spoke-data/albert-xxlarge-v2-description2genre", device_map="auto")albert-xxlarge-v2-description2genre
This model is a fine-tuned version of albert-xxlarge-v2 for multi-label classification with 18 labels. It achieves the following results on the evaluation set:
- Loss: 0.1905
- F1: 0.7058
Usage
# pip install -q transformers accelerate optimum
from transformers import pipeline
pipe = pipeline(
"text-classification",
model="BEE-spoke-data/albert-xxlarge-v2-description2genre"
)
pipe.model = pipe.model.to_bettertransformer()
description = "On the Road is a 1957 novel by American writer Jack Kerouac, based on the travels of Kerouac and his friends across the United States. It is considered a defining work of the postwar Beat and Counterculture generations, with its protagonists living life against a backdrop of jazz, poetry, and drug use." # @param {type:"string"}
result = pipe(description, return_all_scores=True)[0]
print(result)
usage of BetterTransformer (via
optimum) is optional, but recommended unless you enjoy waiting.
Model description
This classifies one or more genre labels in a multi-label setting for a given book description.
The 'standard' way of interpreting the predictions is that the predicted labels for a given example are only the ones with a greater than 50% probability.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 64
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 5.0
Training results
| Training Loss | Epoch | Step | Validation Loss | F1 |
|---|---|---|---|---|
| 0.2903 | 0.99 | 123 | 0.2686 | 0.4011 |
| 0.2171 | 2.0 | 247 | 0.2168 | 0.6493 |
| 0.1879 | 3.0 | 371 | 0.1990 | 0.6612 |
| 0.1476 | 4.0 | 495 | 0.1879 | 0.7060 |
| 0.1279 | 4.97 | 615 | 0.1905 | 0.7058 |
Framework versions
- Transformers 4.33.3
- Pytorch 2.2.0.dev20231001+cu121
- Datasets 2.14.5
- Tokenizers 0.13.3
- Downloads last month
- 55
Model tree for BEE-spoke-data/albert-xxlarge-v2-description2genre
Base model
albert/albert-xxlarge-v2
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="BEE-spoke-data/albert-xxlarge-v2-description2genre")