readme: ---
  language: multilingual
  tags:
  - genre
  - books
  - library
  - historic
  - glam
  license: mit
  metrics:
  - f1
  widget:
  - text: "Poems on various subjects. Whereto is prefixed a short essay on the structure of English verse"
  - text: "Two Centuries of Soho: its institutions, firms, and amusements. By the Clergy of St. Anne's, Soho, J. H. Cardwell ... H. B. Freeman ... G. C. Wilton ... assisted by other contributors, etc"
  - text: "The Adventures of Oliver Twist. [With plates.]"
  
  ---
  
  # British Library Books Genre Detector 
  
  **Note** this model card is a work in progress. 
  
  ## Model description
  
  This fine-tuned [`distilbert-base-cased`](https://huggingface.co/distilbert-base-cased) model is trained to predict whether a book from the [British Library's](https://www.bl.uk/) [Digitised printed books (18th-19th century)](https://www.bl.uk/collection-guides/digitised-printed-books) 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)](https://www.bl.uk/collection-guides/digitised-printed-books) 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](https://livingwithmachines.ac.uk/) 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)](https://www.bl.uk/collection-guides/digitised-printed-books) 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  |
  |-------|------------|
  | mean  |  1864.83   |
  | std   |    43.0199 |
  | min   |  1540      |
  | 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:
  
  | Language            | Count |
  |---------------------|-------|
  | English             | 22987 |
  | Russian             |   461 |
  | French              |   424 |
  | Spanish             |   366 |
  | German              |   347 |
  | Dutch               |   310 |
  | Italian             |   212 |
  | Swedish             |   186 |
  | Danish              |   164 |
  | Hungarian           |   132 |
  | Polish              |   112 |
  | Latin               |    83 |
  | Greek,Modern(1453-) |    42 |
  | Czech               |    25 |
  | Portuguese          |    24 |
  | Finnish             |    14 |
  | Serbian       