--- base_model: microsoft/Multilingual-MiniLM-L12-H384 library_name: setfit metrics: - accuracy pipeline_tag: text-classification tags: - setfit - sentence-transformers - text-classification - generated_from_setfit_trainer widget: - text: 'பரபரப்பான அரசியலுக்கு மத்தியில் மக்களை மகிழ்விக்கும் இரண்டு ஜோக்கர்கள் #நாங்கநலமாஇல்லை_ஸ்டாலின் #DrugLordSudalai #Drug_Mafia_Kazhagam #dravidamodel #Resign_Stalin #DmkDrugSmugglers #DMKFails #GoBackstalin #drugs #Drugs_Mafia_DMK #DMKFails #dmkgovernment #DMKFailsTN #Election2024 ' - text: "திராவிட மாடலின் வளர்ச்சி என்பது சான்றுடன் நிரூபிக்கப்பட்டது! போலியாக உருவாக்கப்பட்ட\ \ பிம்பமல்ல!\n#Dravidianmodel \n#Vote4DMK " - text: '"பயனற்ற MP-யாக மாறன் இருக்கிறார்" #VinojPSelvam #dayanidhimaran #dmk #bjp #CentralChennai ' - text: "நேரிடியாக தனது ஆதரவை பாடலின் மூலம் *நாம் தமிழர் கட்சியின் மைக் சின்னத்திற்கு*\ \ வாக்கு கேட்டு *அண்ணன் விஜய்* அவர்கள் பாடிய பாடல். \n\nகேம்பைன தான் தொறக்கட்டுமா...\n\ *#மைக் க கையில் எடுக்கட்டுமா...*\n\nஎன்று பாடியுள்ளார்\n#மக்களின்_சின்னம்_மைக் " - text: "நமது சின்னம் ஒலிவாங்கி (மைக்)\n#மக்களின்_சின்னம்_மைக்\n#Mike_VoiceOfPeople\n\ #Elections2024\n#கள்ளக்குறிச்சி\n \n " inference: true --- # SetFit with microsoft/Multilingual-MiniLM-L12-H384 This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [microsoft/Multilingual-MiniLM-L12-H384](https://huggingface.co/microsoft/Multilingual-MiniLM-L12-H384) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification. The model has been trained using an efficient few-shot learning technique that involves: 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning. 2. Training a classification head with features from the fine-tuned Sentence Transformer. ## Model Details ### Model Description - **Model Type:** SetFit - **Sentence Transformer body:** [microsoft/Multilingual-MiniLM-L12-H384](https://huggingface.co/microsoft/Multilingual-MiniLM-L12-H384) - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance - **Maximum Sequence Length:** 512 tokens - **Number of Classes:** 7 classes ### Model Sources - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit) - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055) - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit) ### Model Labels | Label | Examples | |:------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 2 | | | 0 | | | 6 | | | 3 | | | 4 | | | 1 | | | 5 | | ## Uses ### Direct Use for Inference First install the SetFit library: ```bash pip install setfit ``` Then you can load this model and run inference. ```python from setfit import SetFitModel # Download from the 🤗 Hub model = SetFitModel.from_pretrained("livinNector/tam-political-classification-setfit") # Run inference preds = model("\"பயனற்ற MP-யாக மாறன் இருக்கிறார்\" #VinojPSelvam #dayanidhimaran #dmk #bjp #CentralChennai ") ``` ## Training Details ### Training Set Metrics | Training set | Min | Median | Max | |:-------------|:----|:--------|:----| | Word count | 1 | 17.8534 | 348 | | Label | Training Sample Count | |:------|:----------------------| | 0 | 1361 | | 1 | 790 | | 2 | 637 | | 3 | 575 | | 4 | 412 | | 5 | 406 | | 6 | 171 | ### Training Hyperparameters - batch_size: (32, 32) - num_epochs: (1, 1) - max_steps: -1 - sampling_strategy: oversampling - num_iterations: 1 - body_learning_rate: (2e-05, 1e-05) - head_learning_rate: 0.01 - loss: CosineSimilarityLoss - distance_metric: cosine_distance - margin: 0.25 - end_to_end: True - use_amp: False - warmup_proportion: 0.1 - l2_weight: 0.01 - seed: 42 - eval_max_steps: -1 - load_best_model_at_end: True ### Training Results | Epoch | Step | Training Loss | Validation Loss | |:------:|:----:|:-------------:|:---------------:| | 0.0074 | 1 | 0.438 | - | | 0.3676 | 50 | 0.3051 | - | | 0.7353 | 100 | 0.2648 | 0.2556 | ### Framework Versions - Python: 3.10.12 - SetFit: 1.1.0 - Sentence Transformers: 3.3.1 - Transformers: 4.45.2 - PyTorch: 2.4.1+cu121 - Datasets: 3.2.0 - Tokenizers: 0.20.3 ## Citation ### BibTeX ```bibtex @article{https://doi.org/10.48550/arxiv.2209.11055, doi = {10.48550/ARXIV.2209.11055}, url = {https://arxiv.org/abs/2209.11055}, author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren}, keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences}, title = {Efficient Few-Shot Learning Without Prompts}, publisher = {arXiv}, year = {2022}, copyright = {Creative Commons Attribution 4.0 International} } ```