CoolFace
Modelpublic

disham993/electrical-classification-bert-large

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes23downloads
README.md102 linesDownload Raw Back to root
1---2language: en3license: mit4base_model: google-bert/bert-large-uncased5tags:6- text-classification7- bert-large-uncased8datasets:9- disham993/ElectricalDeviceFeedbackBalanced10metrics:11- epoch: 512- eval_f1: 0.892813- eval_accuracy: 0.889714- eval_runtime: 2.580615- eval_samples_per_second: 523.90516- eval_steps_per_second: 16.66317library_name: transformers18---19 20# electrical-classification-bert-large-uncased21 22## Model description23 24This model is fine-tuned from [google-bert/bert-large-uncased](https://huggingface.co/google-bert/bert-large-uncased) for text classification tasks, specifically sentiment analysis of customer feedback on electrical devices - circuit breakers, transformers, smart meters, inverters, solar panels, power strips etc. The model has been optimized to classify sentiments into categories such as Positive, Negative, Neutral, and Mixed with high precision and recall, making it ideal for analyzing product reviews, customer surveys, and other feedback to derive actionable insights. 25 26## Training Data27 28The model was trained on the [disham993/ElectricalDeviceFeedbackBalanced](https://huggingface.co/datasets/disham993/ElectricalDeviceFeedbackBalanced) dataset, which has been carefully balanced to address class imbalances effectively. Original dataset which is imbalanced: [disham993/ElectricalDeviceFeedback](https://huggingface.co/datasets/disham993/ElectricalDeviceFeedback).29 30## Model Details31- **Base Model:** [google-bert/bert-large-uncased](https://huggingface.co/google-bert/bert-large-uncased)32- **Task:** text-classification33- **Language:** en34- **Dataset:** [disham993/ElectricalDeviceFeedbackBalanced](https://huggingface.co/datasets/disham993/ElectricalDeviceFeedbackBalanced)35 36## Training procedure37 38### Training hyperparameters39 40The model was fine-tuned using the following hyperparameters:41 42- **Evaluation Strategy:** epoch43- **Learning Rate:** 1e-544- **Batch Size:** 32 (for both training and evaluation)45- **Number of Epochs:** 546- **Weight Decay:** 0.0147 48## Evaluation results49 50The following metrics were achieved during evaluation:51 52- **F1 Score:** 0.892853- **Accuracy:** 0.889754- **eval_runtime**: 2.580655- **eval_samples_per_second**: 523.90556- **eval_steps_per_second**: 16.66357 58## Usage59 60You can use this model for Sentiment Analysis of the Electrical Device Feedback as follows:61 62 63```python64from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline65 66model_name = "disham993/electrical-classification-bert-large"67tokenizer = AutoTokenizer.from_pretrained(model_name)68model = AutoModelForSequenceClassification.from_pretrained(model_name)69nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)70 71text = "The new washing machine is efficient but produces a bit of noise."72classification_results = nlp(text)73print(classification_results)74```75 76## Limitations and bias77 78The dataset includes synthetic data generated using Llama 3.1:8b, and despite careful optimization and prompt engineering, the model is not immune to errors in labeling. Additionally, as LLM technology is still in its early stages, there may be inherent inaccuracies or biases in the generated data that can impact the model's performance.79 80This model is intended for research and educational purposes only, and users are encouraged to validate results before applying them to critical applications.81 82## Training Infrastructure83 84For a complete guide covering the entire process - from data tokenization to pushing the model to the Hugging Face Hub - please refer to the [GitHub repository](https://github.com/di37/classification-electrical-feedback-finetuning).85 86## Last update87 882025-01-0589 90## Citation 91 92```93@misc{modernbert,94      title={Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inference}, 95      author={Benjamin Warner and Antoine Chaffin and Benjamin Clavié and Orion Weller and Oskar Hallström and Said Taghadouini and Alexis Gallagher and Raja Biswas and Faisal Ladhak and Tom Aarsen and Nathan Cooper and Griffin Adams and Jeremy Howard and Iacopo Poli},96      year={2024},97      eprint={2412.13663},98      archivePrefix={arXiv},99      primaryClass={cs.CL},100      url={https://arxiv.org/abs/2412.13663}, 101}102```