{"id":20114748,"url":"https://github.com/gatenlp/stanceclassifier","last_synced_at":"2025-05-06T13:32:21.299Z","repository":{"id":39724319,"uuid":"204195938","full_name":"GateNLP/StanceClassifier","owner":"GateNLP","description":"Stance Classifier for the WeVerify project","archived":false,"fork":false,"pushed_at":"2025-02-11T16:34:01.000Z","size":29343,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-09T12:38:00.460Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GateNLP.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-08-24T18:21:32.000Z","updated_at":"2025-02-05T08:37:43.000Z","dependencies_parsed_at":"2022-09-20T09:33:53.719Z","dependency_job_id":"0ed69b4f-c4db-489f-827f-e5fec78a00da","html_url":"https://github.com/GateNLP/StanceClassifier","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GateNLP%2FStanceClassifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GateNLP%2FStanceClassifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GateNLP%2FStanceClassifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GateNLP%2FStanceClassifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GateNLP","download_url":"https://codeload.github.com/GateNLP/StanceClassifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252693655,"owners_count":21789732,"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":[],"created_at":"2024-11-13T18:31:43.110Z","updated_at":"2025-05-06T13:32:16.290Z","avatar_url":"https://github.com/GateNLP.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StanceClassifier\nStance Classifier for the WeVerify project\n\nThis is a re-implementation of Aker et al. (2017) [\"Simple Open Stance Classification for Rumour Analysis\"](https://arxiv.org/pdf/1708.05286.pdf). We replaced the Bag-of-words and BROWN features with [GloVe embeddings](https://nlp.stanford.edu/projects/glove/) (twitter embeddings with 200 dimensions). \n\n## Configuration\n1) Requirements:\n\n        python3.7\n        nltk\n        numpy\n        scipy\n        sklearn\n    \n        Get Vader lexicon: \n        `python -m nltk.downloader vader_lexicon`\n\n2) Clone this repository\n\n3) Download the [resources](https://github.com/GateNLP/StanceClassifier/releases/download/v0.1/resources.tar.gz) required for feature extraction and extract it inside the main folder (`StanceClassifer`)\n\n4) Download the trained model or models that you want to use - each model is provided as a `tar.gz` file which should be unpacked in this folder, e.g. `curl -L \u003cdownload_url\u003e | tar xvzf -`\n\n - [Ensemble model](https://github.com/GateNLP/StanceClassifier/releases/download/v0.2/model-ensemble.tar.gz): an English-language feature-based ensemble model built with Logistic Regression, Random Forest and Multi-Layer Perceptron classifiers\n - [English BERT-based model](https://github.com/GateNLP/StanceClassifier/releases/download/v0.2/model-bert-english.tar.gz): Monolingual English BERT-based model, i.e. fine-tuning of BERT for the rumour stance classification task, using threshold moving for imbalanced data treatment\n - [Multilingual BERT-based model](https://github.com/GateNLP/StanceClassifier/releases/download/v0.2/model-bert-multi.tar.gz): Multilingual version of the BERT-based model, tuned on the same English data as the above but based on the [multilingual BERT](https://github.com/google-research/bert/blob/master/multilingual.md) underlying model\n\n## Usage\n\n### Basic usage\n```\npython -m StanceClassifier -l \u003cLANGUAGE\u003e -s \u003cORIGINAL_JSON\u003e -o \u003cREPLY_JSON\u003e -c \u003cMODEL\u003e\n```\nSupported model names for the `-c` option: `ens` (ensemble), `bert-english` (English BERT model), `bert-multilingual` (multilingual BERT model)\n\nThe output is a class:\n - 0.0 = support\n - 1.0 = deny\n - 2.0 = query\n - 3.0 = comment\n\nand a vector with the probabilities returned for each class.\n\nThe folder `examples` contains examples of original tweets and replies:\n - original_old and reply_old are examples of the old JSON files (140 characters)\n - original_new and reply_new are examples of the new JSON files (280 characters)\n\n### `StanceClassifer` class (StanceClassifier.stance_classifier.StanceClassifier)\nThis is the main class in this project. If you want to add this project as part of your own project, you should import this class. \n\n### Server usage\nWe have implemented TCP and HTTP servers. Server parameters are defined in the `configurations.txt` file.\n\nTo run the TCP server:\n```\npython Run_TCP_StanceClassifier_Server.py\n```\n\nTesting the TCP server:\n```\npython Test_Run_TCP_StanceClassifier_Server.py\n```\n\nThe HTTP server uses a TCP server already running:\n```\npython Run_HTTP_StanceClassifier_Server.py\n```\n\nTo test the HTTP server:\n```\npython Test_Run_HTTP_StanceClassifier_Server.py\n```\n\nIn addition, the `docker` directory contains configuration to build a Docker image running a particular model of the classifier as an HTTP endpoint compliant with the [API specification](https://european-language-grid.readthedocs.io/en/release1.1.2/all/A2_API/LTInternalAPI.html) of the [European Language Grid](https://www.european-language-grid.eu).\n\n### Training new models\nTo train new models, you can edit `train_model.py` (more support will be given in the future). To run:\n```\npython train_model.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgatenlp%2Fstanceclassifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgatenlp%2Fstanceclassifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgatenlp%2Fstanceclassifier/lists"}