Commit
•
0352dce
1
Parent(s):
9b4982c
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ article = """
|
|
36 |
This demo allows you to play with a 'genre' detection model which has been trained to predict, from the title of a book, whether it is 'fiction' or 'non-fiction'.
|
37 |
|
38 |
|
39 |
-
The [model](https://huggingface.co/
|
40 |
The demo also shows you which parts of the input the model is using most to make its prediction. The examples include titles from the BL books collection. You may notice that the model makes mistakes on short titles in particular, this can partly be explained by the title format in the original data. For example the novel *'Vanity Fair'* by William Makepeace Thackeray
|
41 |
is found in the training data as:
|
42 |
|
@@ -65,9 +65,9 @@ The model is trained on a particular collection of books digitised by the Britis
|
|
65 |
"""
|
66 |
|
67 |
|
68 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
69 |
|
70 |
-
model = AutoModelForSequenceClassification.from_pretrained("
|
71 |
classifier = pipeline('text-classification',model=model, tokenizer=tokenizer, top_k=10)
|
72 |
|
73 |
|
|
|
36 |
This demo allows you to play with a 'genre' detection model which has been trained to predict, from the title of a book, whether it is 'fiction' or 'non-fiction'.
|
37 |
|
38 |
|
39 |
+
The [model](https://huggingface.co/TheBritishLibrary/bl-books-genre) was trained on training data drawn from [digitised books](https://www.bl.uk/collection-guides/digitised-printed-books) at the British Library. These Books are mainly from the 19th Century.
|
40 |
The demo also shows you which parts of the input the model is using most to make its prediction. The examples include titles from the BL books collection. You may notice that the model makes mistakes on short titles in particular, this can partly be explained by the title format in the original data. For example the novel *'Vanity Fair'* by William Makepeace Thackeray
|
41 |
is found in the training data as:
|
42 |
|
|
|
65 |
"""
|
66 |
|
67 |
|
68 |
+
tokenizer = AutoTokenizer.from_pretrained("TheBritishLibrary/bl-books-genre")
|
69 |
|
70 |
+
model = AutoModelForSequenceClassification.from_pretrained("TheBritishLibrary/bl-books-genre")
|
71 |
classifier = pipeline('text-classification',model=model, tokenizer=tokenizer, top_k=10)
|
72 |
|
73 |
|