{"id":20253385,"url":"https://github.com/smappnyu/smaberta","last_synced_at":"2025-04-10T23:43:16.016Z","repository":{"id":56436337,"uuid":"229139736","full_name":"SMAPPNYU/SMaBERTa","owner":"SMAPPNYU","description":"Wrapper for stable version of RoBERTa language models","archived":false,"fork":false,"pushed_at":"2023-06-12T21:28:11.000Z","size":177,"stargazers_count":10,"open_issues_count":5,"forks_count":9,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-10T23:43:11.950Z","etag":null,"topics":["huggingface","nlp","roberta","transfer-learning"],"latest_commit_sha":null,"homepage":"https://csmapnyu.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SMAPPNYU.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-12-19T21:14:02.000Z","updated_at":"2023-02-21T18:46:26.000Z","dependencies_parsed_at":"2024-11-14T13:15:55.090Z","dependency_job_id":null,"html_url":"https://github.com/SMAPPNYU/SMaBERTa","commit_stats":{"total_commits":36,"total_committers":4,"mean_commits":9.0,"dds":0.5833333333333333,"last_synced_commit":"04ac51bf7c2a96e6fcc0f452a5c8a135c6a98e96"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAPPNYU%2FSMaBERTa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAPPNYU%2FSMaBERTa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAPPNYU%2FSMaBERTa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SMAPPNYU%2FSMaBERTa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SMAPPNYU","download_url":"https://codeload.github.com/SMAPPNYU/SMaBERTa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317726,"owners_count":21083527,"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","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":["huggingface","nlp","roberta","transfer-learning"],"created_at":"2024-11-14T10:23:42.697Z","updated_at":"2025-04-10T23:43:15.994Z","avatar_url":"https://github.com/SMAPPNYU.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SMaBERTa\n\n\u003ca href=\"https://badge.fury.io/py/SMaBERTa\"\u003e\u003cimg src=\"https://badge.fury.io/py/smaberta.svg\" alt=\"PyPI version\" height=\"18\"\u003e\u003c/a\u003e\n\u003ca href=\"https://doi.org/10.5281/zenodo.5090728\"\u003e\u003cimg src=\"https://zenodo.org/badge/DOI/10.5281/zenodo.5090728.svg\" alt=\"DOI\"\u003e\u003c/a\u003e\n\nThis repository contains the code for SMaBERTa, a wrapper for the huggingface transformer libraries.\nIt was developed by Zhanna Terechshenko and Vishakh Padmakumar through research at the Center for \nSocial Media and Politics at NYU.\n\n## Setup\n\nTo install using pip, run\n```\npip install smaberta\n```\n\nTo install from the source, first download the repository by running \n\n```\ngit clone https://github.com/SMAPPNYU/SMaBERTa.git\n```\n\nThen, install the dependencies for this repo and setup by running\n```\ncd SMaBERTa\npip install -r requirements.txt\npython setup.py install\n```\n\n## Using the package\n\nBasic use:\n\n```\nfrom smaberta import TransformerModel\n\nepochs = 3\nlr = 4e-6\n\ntraining_sample = ['Today is a great day', 'Today is a terrible day']\ntraining_labels = [1, 0]\n\nmodel = TransformerModel('roberta', 'roberta-base', num_labels=25, reprocess_input_data=True, \n                         num_train_epochs=epochs, learning_rate=lr, output_dir='./saved_model/', \n                         overwrite_output_dir=True, fp16=False)\n\nmodel.train(training_sample, training_labels)\n\n```\n\nFor further details, see `Tutorial.ipynb` in the [examples](https://github.com/SMAPPNYU/SMaBERTa/tree/master/examples) directory.\n\n# Acknowledgements \n\nCode for this project was adapted from version 0.6 of https://github.com/ThilinaRajapakse/simpletransformers\n\nVishakh Padmakumar and Zhanna Terechshenko contributed to the software writing, implementation, and testing.\n\nMegan Brown contributed to documentation and publication.\n\nIf you use this software in your research please cite it as:\n\n```\n@misc{padmakumar_terechshenko,\n  author       = {Vishakh Padmakumar and Zhanna Terechshenko},\n  title        = {SMAPPNYU/SMaBERTa},\n  month        = dec,\n  year         = 2020,\n  doi          = {10.5281/zenodo.5090728},\n  url          = {https://doi.org/10.5281/zenodo.5090728}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmappnyu%2Fsmaberta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmappnyu%2Fsmaberta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmappnyu%2Fsmaberta/lists"}