book genre classifiers
Collection
text classification models for book genres
•
5 items
•
Updated
•
1
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:
# 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.
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.
The following hyperparameters were used during training:
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 |
Base model
albert/albert-xxlarge-v2