{"id":20017726,"url":"https://github.com/eliask93/debertav3-for-aspect-based-sentiment-analysis","last_synced_at":"2025-08-12T14:45:27.471Z","repository":{"id":254437119,"uuid":"460959405","full_name":"EliasK93/debertav3-for-aspect-based-sentiment-analysis","owner":"EliasK93","description":"Application for training the pretrained transformer model DeBERTaV3 on an Aspect Based Sentiment Analysis task","archived":false,"fork":false,"pushed_at":"2024-12-25T23:18:22.000Z","size":1531,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T15:39:33.070Z","etag":null,"topics":["amazon-reviews","aspect-based-sentiment-analysis","deberta","deberta-v3","nlp","simpletransformers","spacy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EliasK93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-18T18:15:14.000Z","updated_at":"2025-03-10T06:58:54.000Z","dependencies_parsed_at":"2025-04-06T15:44:12.745Z","dependency_job_id":null,"html_url":"https://github.com/EliasK93/debertav3-for-aspect-based-sentiment-analysis","commit_stats":null,"previous_names":["eliask93/debertav3-for-aspect-based-sentiment-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EliasK93/debertav3-for-aspect-based-sentiment-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliasK93%2Fdebertav3-for-aspect-based-sentiment-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliasK93%2Fdebertav3-for-aspect-based-sentiment-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliasK93%2Fdebertav3-for-aspect-based-sentiment-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliasK93%2Fdebertav3-for-aspect-based-sentiment-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EliasK93","download_url":"https://codeload.github.com/EliasK93/debertav3-for-aspect-based-sentiment-analysis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EliasK93%2Fdebertav3-for-aspect-based-sentiment-analysis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270079979,"owners_count":24523634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-reviews","aspect-based-sentiment-analysis","deberta","deberta-v3","nlp","simpletransformers","spacy"],"created_at":"2024-11-13T08:18:12.712Z","updated_at":"2025-08-12T14:45:27.430Z","avatar_url":"https://github.com/EliasK93.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## DeBERTaV3 for Aspect Based Sentiment Analysis\n\nApplication for training the pretrained transformer model DeBERTaV3 (see paper [DeBERTaV3: Improving DeBERTa\nusing ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing](https://arxiv.org/abs/2111.09543)) on an *Aspect Based Sentiment Analysis* task.\n\nAspect Based Sentiment Analysis is a Sequence Labeling task where product reviews are labeled with their\n*aspects* as well as the detected *sentiments* towards each of these aspects.\nAspects in the context of product reviews are N-Grams explicitly mentioning specific functionalities, parts and related \nservices around the product, with the part of speech being limited to nouns, noun phrases or verbs.\n\n\n| \u003ckbd\u003e![](imgs/absa_example.JPG)\u003c/kbd\u003e     |\n|:-----------------------------------------:|\n| *Example of an annotated product review*  |\n\nTraining data source for the model were 1.570 sampled product reviews (5.872 sentences) from the [Amazon Review Dataset](https://nijianmo.github.io/amazon/index.html) - \nspecifically from the five product categories `Laptops`, `Cell Phones`, `Mens Running Shoes`, `Vacuums`, `Plush Figures` - \nwhich I manually annotated for my bachelor's thesis following a modified version of the [SemEval2014 Aspect Based Sentiment Analysis guidelines](http://alt.qcri.org/semeval2014/task4/data/uploads/semeval14_absa_annotationguidelines.pdf) and the annotation tool [Universal Data Tool](https://udt.dev).\n\nThe model was trained for 10 epochs on the combined dataset from all five categories (training time: 02h:05m:03s on NVIDIA GeForce GTX 1660 Ti).\nModel training, evaluation and inference is implemented using the wrapper [simpletransformers](https://simpletransformers.ai/) which uses [huggingface](https://huggingface.co/).\nSince it requires word tokenized and sentence tokenized inputs, the raw text is first pre-processed using [SpaCy](https://spacy.io/).\n\nThe frontend and routing is implemented in [Flask](https://flask.palletsprojects.com), using [Jinja](https://jinja.palletsprojects.com) as Template Engine for rendering the HTML and [Bootstrap](https://getbootstrap.com/) for the frontend design.\n\n\u003cbr\u003e\n\n\n### Model Evaluation on Test Set\n\n|               Metric              |  microsoft/deberta-v3-base  |\n|:---------------------------------:|:---------------------------:|\n|            Precision              | 0.659                       |\n|            Recall                 | 0.691                       |\n|            Micro F1-Score         | 0.675                       |\n\n\u003cbr\u003e\n\n### Examples of product reviews labeled by the model\n\n\n##### Trained category (Laptops), 5 stars:\n\n\u003ckbd\u003e![](imgs/laptops_5.png)\u003c/kbd\u003e\n\n\u003cbr\u003e\n\n##### Non-trained category (Power Drills), 4 stars:\n\n\u003ckbd\u003e![](imgs/power_drill_4.png)\u003c/kbd\u003e\n\n\u003cbr\u003e\n\n##### Non-trained category (Backpacks), 1 star:\n\n\u003ckbd\u003e![](imgs/backpack_1.png)\u003c/kbd\u003e\n\n\u003cbr\u003e\n\n### Requirements\n\n##### - Python \u003e= 3.10\n\n##### - Conda\n  - `pytorch==2.6.0`\n  - `cudatoolkit=12.6`\n\n##### - pip\n  - `simpletransformers`\n  - `spacy`\n  - `pandas`\n  - `openpyxl`\n  - `tqdm`\n  - `flask`\n\n##### - SpaCy models\n  - `en_core_web_lg`\n\n\u003cbr\u003e\n\n### Notes\n\nThe uploaded versions of the training data in this repository are cut off after the first 1.000 rows of each file, the \nreal training data contains a combined ~90.000 rows. The trained model file `pytorch_model.bin` is omitted in this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliask93%2Fdebertav3-for-aspect-based-sentiment-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliask93%2Fdebertav3-for-aspect-based-sentiment-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliask93%2Fdebertav3-for-aspect-based-sentiment-analysis/lists"}