/ Модель

Характеристики

Контекст
512 токенов
Лицензия
MIT
Архитектура
distilbert · dense
Опубликована
2 мар 2022

bl-books-genre

Классификация текстаТекст → label3 профессии

Классификатор названий книг, который определяет, относятся они к художественной или нехудожественной литературе.

57скачиваний за 30 дней7лайковвеса обновлены9 ноя 2023

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель British Library Books Genre Detector разработана Британской библиотекой и дообучена на базе distilbert-base-cased. Она классифицирует название книги как fiction или non-fiction, помогая распределять записи о книгах по этим двум широким категориям. Модель создана для коллекции оцифрованных печатных книг Британской библиотеки XVIII–XIX веков и может применяться для первичной разметки похожих библиотечных каталогов.

Модель принимает текст названия книги и выдаёт класс. Она обучалась преимущественно на англоязычных названиях; в данных также были другие языки, включая русский, но значительно реже. Контекст составляет 512 токенов. Лицензия — MIT.

Качество может снижаться на современных названиях и каталогах с другими правилами описания. Обучающая выборка смещена к поздним годам, а часть меток была получена автоматически, поэтому предсказания следует считать грубой жанровой оценкой.

Сценарии применения

  • разделение названий исторических книг на художественные и нехудожественные
  • первичная жанровая разметка записей библиотечного каталога
  • сегментация коллекции оцифрованных книг для дальнейшего анализа

Ограничения

Обучающая выборка состоит главным образом из англоязычных названий книг XIX века, поэтому другие языки, современные названия и каталоги с иными правилами описания могут снижать точность. Часть обучающих меток расширена автоматическими правилами, а классификация сводится к двум грубым категориям.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

British Library Books Genre Detector

Note this model card is a work in progress.

Model description

This fine-tuned distilbert-base-cased model is trained to predict whether a book from the British Library's Digitised printed books (18th-19th century) book collection is fiction or non-fiction based on the title of the book.

Intended uses & limitations

This model was trained on data created from the Digitised printed books (18th-19th century) book collection. The datasets in this collection are comprised and derived from 49,455 digitised books (65,227 volumes) largely from the 19th Century. This dataset is dominated by English language books but also includes books in a number of other languages in much smaller numbers. Whilst a subset of this data has metadata relating to Genre, the majority of this dataset does not currently contain this information.

This model was originally developed for use as part of the Living with Machines project in order to be able to 'segment' this large dataset of books into different categories based on a 'crude' classification of genre i.e. whether the title was fiction or non-fiction.

Particular areas where the model might be limited are:

Title format

The model's training data (discussed more below) primarily consists of 19th Century book titles that have been catalogued according to British Library cataloguing practices. Since the approaches taken to cataloguing will vary across institutions running the model on titles from a different catalogue might introduce domain drift and lead to degraded model performance.

To give an example of the types of titles includes in the training data here are 20 random examples:

  • 'The Canadian farmer. A missionary incident [Signed: W. J. H. Y, i.e. William J. H. Yates.]
  • 'A new musical Interlude, called the Election [By M. P. Andrews.]',
  • 'An Elegy written among the ruins of an Abbey. By the author of the Nun [E. Jerningham]',
  • "The Baron's Daughter. A ballad by the author of Poetical Recreations [i.e. William C. Hazlitt] . F.P",
  • 'A Little Book of Verse, etc',
  • 'The Autumn Leaf Poems',
  • 'The Battle of Waterloo, a poem',
  • 'Maximilian, and other poems, etc',
  • 'Fabellæ mostellariæ: or Devonshire and Wiltshire stories in verse; including specimens of the Devonshire dialect',
  • 'The Grave of a Hamlet and other poems, chiefly of the Hebrides ... Selected, with an introduction, by his son J. Hogben']

Date

The model was trained on data that spans the collection period of the Digitised printed books (18th-19th century) book collection. This dataset covers a broad period (from 1500-1900). However, this dataset is skewed towards later years. The subset of training data i.e. data with genre annotations used to train this model has the following distribution for dates:

Date
mean1864.83
std43.0199
min1540
25%1847
50%1877
75%1893

Language

Whilst the model is multilingual in so far as it has training data in non-English book titles, these appear much less frequently. An overview of the original training data's language counts are as follows:

LanguageCount
English22987
Russian461
French424
Spanish366
German347
Dutch310
Italian212
Swedish186
Danish164
Hungarian132
Polish112
Latin83
Greek,Modern(1453-)42
Czech25
Portuguese24
Finnish14
Serbian10
Bulgarian7
Icelandic4
Irish4
Hebrew2
NorwegianNynorsk2
Lithuanian2
Slovenian2
Cornish1
Romanian1
Slovak1
Scots1
Sanskrit1

How to use

There are a few different ways to use the model. To run the model locally the easiest option is to use the 🤗 Transformers pipelines:

from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
tokenizer = AutoTokenizer.from_pretrained("davanstrien/bl-books-genre")
model = AutoModelForSequenceClassification.from_pretrained("davanstrien/bl-books-genre")
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
classifier("Oliver Twist")

This will return a dictionary with our predicted label and score

[{'label': 'Fiction', 'score': 0.9980145692825317}]

If you intend to use this model beyond initial experimentation, it is highly recommended to create some data to validate the model's predictions. As the model was trained on a specific corpus of books titles, it is also likely to be beneficial to fine-tune the model if you want to run it across a collection of book titles that differ from those in the training corpus.

Training data

The training data was created using the Zooniverse platform and the annotations were done by cataloguers from the British Library. Snorkel was used to expand on this original training data through various labelling functions. As a result, some of the labels are not generated by a human. More information on the process of creating the annotations can be found here

Training procedure

The model was trained using the blurr library. A notebook showing the training process can be found in Predicting Genre with Machine Learning.

Eval results

The results of the model on a held-out training set are:

              precision    recall  f1-score   support

     Fiction       0.88      0.97      0.92       296
 Non-Fiction       0.98      0.93      0.95       554

    accuracy                           0.94       850
   macro avg       0.93      0.95      0.94       850
weighted avg       0.95      0.94      0.94       850

As discussed briefly in the bias and limitation sections of the model these results should be treated with caution. **

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
DistilBertForSequenceClassification
Ревизия весов
a9b0ccb

0 моделей