Downloads · 30 days
14
33% of all-time downloads
GuillermoTBB/charles-dickens-classifier
charles-dickens-classifier is a text classification model from GuillermoTBB. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
14
33% of all-time downloads
All-time downloads
43
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
Charles Dickens Text Classifier
This model is a text classification model fine-tuned on a dataset designed to distinguish between paragraphs written by Charles Dickens and those that imitate his style. The model uses distilbert-base-uncased as the base model and has been fine-tuned on 1,100 samples with 100 positive and 1,000 negative examples, achieving an accuracy of 99.5%.
This is a text classification model developed to classify text as either written by Charles Dickens or generated in different styles. It is built using the distilbert-base-uncased model from the Hugging Face Transformers library and fine-tuned on a dataset specifically designed for this task.
distilbert/distilbert-base-uncasedThis model can be directly used for distinguishing between authentic Charles Dickens texts and texts generated in various imitative styles. It can be used for literary analysis, text style transfer evaluation, and educational purposes.
This model is not suitable for general text classification tasks outside of the scope of identifying Charles Dickens' writing style. Misuse of the model might include applying it to texts outside of the intended use case or in a context where the stylistic nuances of Dickens' writing are not relevant.
The model may have biases related to the synthetic nature of the negative examples, which might not fully capture the diversity of non-Dickensian writing styles. The dataset is based only on "Great Expectations" and might not generalize well to other works by Dickens or other authors.
Users should be aware of the synthetic nature of the negative samples, which might limit the model's generalizability. It is recommended to expand the dataset to include more works by Dickens for a more robust classification.
To use this model, load it using the Hugging Face Transformers library:
from transformers import pipeline
classifier = pipeline("text-classification", model="GuillermoTBB/charles-dickens-classifier", tokenizer="GuillermoTBB/charles-dickens-classifier")
text = "Your text here..."
result = classifier(text)
print(result)
An example to use this model can be found in this colab used to validate different methods to transfer text style.
The model was trained on a dataset composed of 1,100 paragraphs, where 100 were original excerpts from "Great Expectations" by Charles Dickens and 1,000 were synthetic examples generated by rewriting the Dickensian paragraphs in 10 distinct styles using GPT-4. Dataset can be found HF GuillermoTBB/charles-dickens-text-classification
The model was fine-tuned using the following hyperparameters:
The test set consisted of 220 samples, stratified to maintain a balanced class distribution.
The primary evaluation metric was accuracy, which is ideal for binary classification tasks. The model achieved a test accuracy of 99.5%.
The model performed exceptionally well on the test set with an accuracy of 99.5%, demonstrating its effectiveness in distinguishing between Dickensian and non-Dickensian text.
The model is based on the distilbert-base-uncased architecture, fine-tuned to perform binary text classification.
Please cite the following if you use this model:
BibTeX:
@misc{guillermo2024charlesdickens,
title={Charles Dickens Text Classifier},
author={Guillermo Blasco},
year={2024},
howpublished={\url{https://huggingface.co/GuillermoTBB/charles-dickens-classifier}},
}
**APA:**
Blasco, G. (2024). Charles Dickens Text Classifier. Retrieved from https://huggingface.co/GuillermoTBB/charles-dickens-classifier.
## Model Card Authors
- Guillermo Blasco, Independent ML Engineer