Edit model card

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
23
Safetensors
Model size
223M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for BEE-spoke-data/albert-xxlarge-v2-description2genre

Finetuned
(6)
this model

Collection including BEE-spoke-data/albert-xxlarge-v2-description2genre