{"id":16577169,"url":"https://github.com/fhamborg/newsmtsc","last_synced_at":"2025-04-07T07:10:10.811Z","repository":{"id":45453094,"uuid":"355885500","full_name":"fhamborg/NewsMTSC","owner":"fhamborg","description":"Target-dependent sentiment classification in news articles reporting on political events. Includes a high-quality data set of over 11k sentences and a state-of-the-art classification model.","archived":false,"fork":false,"pushed_at":"2023-12-20T16:17:09.000Z","size":4818,"stargazers_count":132,"open_issues_count":4,"forks_count":20,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-05-01T19:23:57.836Z","etag":null,"topics":["cuda","dataset","deep-learning","news-articles","pytorch","sentiment-analysis","sentiment-classification","text-classification","tsc"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fhamborg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-04-08T11:47:31.000Z","updated_at":"2024-04-27T15:19:26.000Z","dependencies_parsed_at":"2023-02-19T10:45:47.943Z","dependency_job_id":"629d71f6-4eb1-410f-850e-6625b8a4e3c4","html_url":"https://github.com/fhamborg/NewsMTSC","commit_stats":{"total_commits":126,"total_committers":7,"mean_commits":18.0,"dds":0.2936507936507936,"last_synced_commit":"a7bea7bc7265b4bfe4236e98965a47c767acbb30"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhamborg%2FNewsMTSC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhamborg%2FNewsMTSC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhamborg%2FNewsMTSC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhamborg%2FNewsMTSC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fhamborg","download_url":"https://codeload.github.com/fhamborg/NewsMTSC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"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":["cuda","dataset","deep-learning","news-articles","pytorch","sentiment-analysis","sentiment-classification","text-classification","tsc"],"created_at":"2024-10-11T22:10:02.781Z","updated_at":"2025-04-07T07:10:10.779Z","avatar_url":"https://github.com/fhamborg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NewsMTSC: (Multi-)Target-dependent Sentiment Classification in News Articles\nNewsMTSC is a dataset for target-dependent sentiment classification (TSC) on\nnews articles reporting on policy issues. The dataset consists of more than 11k labeled\nsentences, which we sampled from news articles from online US news outlets. More\ninformation can be found in our paper published at the EACL 2021.\n\nThis repository contains the **dataset** for target-dependent\nsentiment classification in news articles reporting on policy issues. Additionally,\nthe repository contains our **model** named GRU-TSC, which achieves state-of-the-art\nTSC classification performance on NewsMTSC. Check it out - it **works out of the box** :-)\n\n# Quick start\n\n* **I want to classify sentiment**: check out our easy-to-use, high-quality sentiment classifier on [PyPI](https://pypi.org/project/NewsSentiment/)\n* **I need the dataset**: you can [download it here](https://github.com/fhamborg/NewsMTSC/raw/main/NewsSentiment/controller_data/datasets/NewsMTSC-dataset/NewsMTSC-dataset.zip) or [view it here](https://github.com/fhamborg/NewsMTSC/tree/main/NewsSentiment/controller_data/datasets/NewsMTSC-dataset). We also offer NewsMTSC as a dataset on [Huggingface Hub](https://huggingface.co/datasets/fhamborg/news_sentiment_newsmtsc) and on [Kaggle](https://www.kaggle.com/fhamborg/news-articles-sentiment).\n* **I want to train my own models**: read the remainder of this file.\n\nReminder: the following description is only relevant if you in fact want to train your own models. If that's not the case, please check above for links to the dataset and our easy-to-use python package.\n\n\n# Installation\nIt's super easy, we promise! Note that following these instructions is only necessary if you're planning to train a model using our tool. If you only want to predict the sentiment of sentences, please use our [Python package](https://pypi.org/project/NewsSentiment/), which is even easier to install and use :-)\n\nNewsMTSC was tested on MacOS and Ubuntu; other OS may work, too. Let us know :-)\n\n**1. Setup the environment:**\n\nThis step is optional if you have Python 3.8 installed already (`python --version`). If you don't have Python 3.8, we recommend using Anaconda for setting up requirements. If you do not have it yet, follow Anaconda's\n[installation instructions](https://docs.anaconda.com/anaconda/install/). \n\nTo setup a Python 3.8 environment (in case you don't have one yet) you may use, for example:\n```bash\nconda create --yes -n newsmtsc python=3.8\nconda activate newsmtsc\n```\n\nFYI, for users of virtualenv, the equivalent command would be:\n```bash\nvirtualenv -ppython3.8 --setuptools 45 venv\nsource venv/bin/activate\n```\n\nNote: We recommend Python 3.8, however we have successfully tested NewsMTSC with Python version \u003e=3.8, \u003c3.12.\n\n**2. Setup NewsMTSC:**\n```bash\ngit clone git@github.com:fhamborg/NewsMTSC.git\n```\n\nAfterward, for example, open the project in your IDE and follow the instruction described in the section \"Training\".\n\nNote that if you only want to classify sentiment using our model, we recommend that you use our PyPI package [NewsSentiment](https://pypi.org/project/NewsSentiment/). Getting it is as simple as `pip install NewsSentiment` and using it is four lines of code :-)\n\n\n# Training\nIf you want to train one of our models or your own model, please clone the repository first.\n\n\nThere are two entry points to the system. `train.py` is used to train and evaluate a specific model on a specific dataset using\nspecific hyperparameters. We call a single run an _experiment_. `controller.py` is used to run multiple experiments\nautomatically. This is for example useful for model selection and evaluating hundreds or thousands of combinations of\nmodels, hyperparameters, and datasets.\n\n## Running a single experiment\nGoal: training a model with a user-defined (hyper)parameter combination.\n\n`train.py` allows fine-grained control over the training and evaluation process, yet for most command line arguments\nwe provide useful defaults. Two arguments are required:\n\n* `--own_model_name` (which model is used, e.g., `grutsc`),\n* `--dataset_name` (which dataset is used, e.g., `newsmtsc-rw`).\n\nFor more information refer to `train.py` and\n`combinations_absadata_0.py`. If you just want to get started quickly, the command below should work out of the box. \n\n```\npython train.py --own_model_name grutsc --dataset_name newsmtsc-rw\n```\n\n## Running multiple experiments \nGoal: finding the (hyper)parameter combination to train a model that achieves the best performance.\n\n`controller.py` takes a set of values for each argument, creates combinations of arguments, applies conditions to remove\nunnecessary combinations (e.g., some arguments may only be used for a specific model), and creates a multiprocessing\npool to run experiments of these argument combinations in parallel. After completion, `controller.py` creates a summary,\nwhich contains detailed results, including evaluation performance, of all experiments. By using `createoverview.py`, you\ncan export this summary into an Excel spreadsheet.   \n\n# Support\nIf you have questions on how to use NewsMTSC or its library, please create a new [issue](https://github.com/fhamborg/NewsMTSC/issues) on GitHub. Please understand that we are not able to provide individual support via email. We think that help is more valuable if it is shared publicly so that more people can benefit from it.\n\n# Acknowledgements\nThis repository is in part based on [ABSA-PyTorch](https://github.com/songyouwei/ABSA-PyTorch).\nWe thank Song et al. for making their excellent repository open source.\n\n# How to cite\nIf you use the dataset or model, please cite our [paper](https://www.aclweb.org/anthology/2021.eacl-main.142/) ([PDF](https://www.aclweb.org/anthology/2021.eacl-main.142.pdf)):\n\n```\n@InProceedings{Hamborg2021b,\n  author    = {Hamborg, Felix and Donnay, Karsten},\n  title     = {NewsMTSC: (Multi-)Target-dependent Sentiment Classification in News Articles},\n  booktitle = {Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics (EACL 2021)},\n  year      = {2021},\n  month     = {Apr.},\n  location  = {Virtual Event},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhamborg%2Fnewsmtsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffhamborg%2Fnewsmtsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhamborg%2Fnewsmtsc/lists"}