{"id":22246670,"url":"https://github.com/rmsnow/www2021","last_synced_at":"2025-07-28T03:30:50.111Z","repository":{"id":38397645,"uuid":"337024480","full_name":"RMSnow/WWW2021","owner":"RMSnow","description":"Official repository to release the code and datasets in the paper \"Mining Dual Emotion for Fake News Detection\", WWW 2021.","archived":false,"fork":false,"pushed_at":"2021-12-31T03:57:11.000Z","size":5230,"stargazers_count":45,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-06T21:59:38.755Z","etag":null,"topics":["emotion","fake-news-detection","keras","www2021"],"latest_commit_sha":null,"homepage":"https://doi.org/10.1145/3442381.3450004","language":"Jupyter Notebook","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/RMSnow.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}},"created_at":"2021-02-08T09:35:18.000Z","updated_at":"2023-03-06T21:59:38.756Z","dependencies_parsed_at":"2022-09-15T12:12:42.812Z","dependency_job_id":null,"html_url":"https://github.com/RMSnow/WWW2021","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSnow%2FWWW2021","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSnow%2FWWW2021/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSnow%2FWWW2021/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSnow%2FWWW2021/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RMSnow","download_url":"https://codeload.github.com/RMSnow/WWW2021/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227860116,"owners_count":17830733,"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":["emotion","fake-news-detection","keras","www2021"],"created_at":"2024-12-03T05:28:47.272Z","updated_at":"2024-12-03T05:28:48.143Z","avatar_url":"https://github.com/RMSnow.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WWW 2021\n\nThis is the official repository of the paper:\n\n\u003e **Mining Dual Emotion for Fake News Detection.** [[PDF]](https://www.zhangxueyao.com/assets/www2021-dual-emotion-paper.pdf) [[Code]](https://github.com/RMSnow/WWW2021) [[Slides]](https://www.zhangxueyao.com/assets/www2021-dual-emotion-slides.pdf) [[Video]](https://www.zhangxueyao.com/assets/www2021-dual-emotion-video.mp4) [[中文讲解视频]](https://www.bilibili.com/video/BV13o4y1m7c3)\n\u003e\n\u003e Xueyao Zhang, Juan Cao, Xirong Li, Qiang Sheng, Lei Zhong, and Kai Shu. Proceedings of 30th The Web Conference (**WWW 2021**)\n\n## An Overall Framework\n\n![1](https://github.com/RMSnow/WWW2021/blob/master/framework.png)\n\nAn overall framework of using Dual Emotion Features for fake news detection. Dual Emotion Features consist of three components: \n\n**a)** Publisher Emotion extracted from the content; \n\n**b)** Social Emotion extracted from the comments; \n\n**c)** Emotion Gap representing the similarity and difference between publisher emotion and social emotion.\n\nDual Emotion Features are concatenated with the features from **d)** Fake News Detector (here, BiGRU as an example) for the final prediction of veracity.\n\n## Datasets\n\nThe datasets are available at https://drive.google.com/drive/folders/1pjK0BYiiJt0Ya2nRIrOLCVo-o53sYRBV?usp=sharing. The downloaded datasets (i.e., the  `dataset` folder) need to be moved into the root path of this project.\n\n### RumourEval-19\n\nThe raw dataset is released by [SemEval-2019 Task 7](https://competitions.codalab.org/competitions/19938#learn_the_details-overview):\n\n\u003e Genevieve Gorrell, Ahmet Aker, Kalina Bontcheva, Elena Kochkina, Maria Liakata, Arkaitz Zubiaga, Leon Derczynski (2019). SemEval-2019 Task 7: RumourEval, Determining Rumour Veracity and Support for Rumours. Proceedings of the 13th International Workshop on Semantic Evaluation, ACL.\n\nOur experimental dataset is in the folder `dataset/RumourEval-19`, which contains three json files. In every json file,\n\n- the `id` identifies the unique id of the post.\n- the `label` identifies the veracity of the post, whose value ranges in [ `fake`,  `real`, `unverified`]. \n- the `content` is the content of the post.\n- the `comments` are the users' comments list towards the post.\n- the `content_emotions_labels` and `cotent_emotions_probs` are the *Emotion Category* features of the content. And the `comments100_emotions_labels_mean_pooling`, `comments100_emotions_labels_max_pooling`, `comments100_emotions_probs_mean_pooling`, and `comments100_emotions_probs_max_pooling` are the *Emotion Category* features of the earliest 100 comments. The way how to use these features will be described in [here](https://github.com/RMSnow/WWW2021#step12-get-the-emotion-features).\n\n### Weibo-16\n\nThe original dataset is firstly proposed in:\n\n\u003e Jing Ma, Wei Gao, Prasenjit Mitra, Sejeong Kwon, Bernard J Jansen, Kam-Fai Wong, and Meeyoung Cha. 2016. Detecting rumors from microblogs with recurrent neural networks. In IJCAI 2016. 3818–3824.\n\nIn *Section 4.1.2* and *Appendix A* of our paper, we described that there are many fake news duplications in the original dataset. The original version of Weibo-16 is in the folder `dataset/Weibo-16-original`, and our experimental dataset (a deduplicated version) of Weibo-16 is in the folder `dataset/Weibo-16`. In every json file in these folders, \n\n- the `label` identifies the veracity of the post, whose value ranges in [ `fake`,  `real`]. \n- the `content` is the content of the post.\n- the `comments` are the users' comments list towards the post.\n- the `content_emotions` are the *Emotion Category* features of the content. And the `comments100_emotions_mean_pooling` and `comments100_emotions_max_pooling` are the *Emotion Category* features of the earliest 100 comments. The way how to use these features will be described in [here](https://github.com/RMSnow/WWW2021#step12-get-the-emotion-features).\n\n### Weibo-20\n\nWeibo-20 is our newly proposed dataset, and it is in the folder `dataset/Weibo-20`. Besides, in *Section 4.4.3* of the paper, we conducted the experiments under the real-world scenario simulation. This temporal version of Weibo-20 is in the folder `dataset/Weibo-20-temporal`. In every json file in these folders, \n\n- the `label` identifies the veracity of the post, whose value ranges in [ `fake`,  `real`]. \n- the `content` is the content of the post.\n- the `comments` are the users' comments list towards the post.\n- the `content_emotions` are the *Emotion Category* features of the content. And the `comments100_emotions_mean_pooling` and `comments100_emotions_max_pooling` are the *Emotion Category* features of the earliest 100 comments. The way how to use these features will be described in [here](https://github.com/RMSnow/WWW2021#step12-get-the-emotion-features).\n\n## Emotion Resources\n\n| Type                    | Language | Resources                                                    |\n| ----------------------- | -------- | ------------------------------------------------------------ |\n| Emotion Category        | English  | https://github.com/NVIDIA/sentiment-discovery                |\n|                         | Chinese  | https://ai.baidu.com/tech/nlp_apply/emotion_detection        |\n| Emotion Lexicon         | English  | `resources/English/NRC`                                      |\n|                         | Chinese  | `/resources/Chinese/大连理工大学情感词汇本体库`              |\n| Emotional Intensity     | English  | `resources/English/NRC`                                      |\n|                         | Chinese  | `/resources/Chinese/大连理工大学情感词汇本体库`              |\n| Sentiment Score         | English  | [nltk.sentiment.vader.SentimentIntensityAnalyzer](https://www.nltk.org/api/nltk.sentiment.html#nltk.sentiment.vader.SentimentIntensityAnalyzer) |\n|                         | Chinese  | `resources/Chinese/BosonNLP`                                 |\n| Other Auxilary Features | English  | [Wiki: List of emoticons](https://en.wikipedia.org/wiki/List_of_emoticons), `resources/English/HowNet`, `resources/English/others` |\n|                         | Chinese  | `resources/Chinese/HowNet`, `resources/English/others`       |\n\n## Code\n\n### Requirements\n\n```\nPython==3.6.10\nKeras==2.1.2\nTensorflow==1.13.1\nTensorflow-GPU==1.14.0\n```\n\n### Usage\n\n#### Step1: Preprocess\n\n##### Step1.1: Get the `labels`\n\n```\ncd code/preprocess\npython output_of_labels.py\n```\n\n##### Step1.2: Get the `emotion features`\n\n```\ncd code/preprocess\npython input_of_emotions.py\n```\n\nNote that the *Emotion Category* features are depended on the external resources ([NVIDIA-sentiment-discovery](https://github.com/NVIDIA/sentiment-discovery) for English, and [Baidu AI](https://ai.baidu.com/tech/nlp_apply/emotion_detection) for Chinese). And they have been saved in the dataset files (e.g.: `content_emotions`, `comments100_emotions_mean_pooling`, `content_emotions_probs`, `comments100_emotions_labels_max_pooling`, etc.). \n\nIf you want to extract emotion features for your custom datasets, you need to access these external resources and prepare *Emotion Category* features. Of course,  you can also leave *Emotion Category* unused and extract other features by `input_of_emotion.py`.\n\n##### Step1.3: Get the `semantic features`\n\nIn this repo, we consider the semantic features as word embeddings. You need to download the preprained word embeddings ([see here](https://github.com/RMSnow/WWW2021/blob/master/word-embedding/readme.md) for more details) before running the following code:\n\n```\ncd code/preprocess\npython input_of_semantics.py\n```\n\nNow, the preprocessed data are stored in `preprocess/data`.\n\n#### Step 2: Configuration\n\nConfig the experimental dataset, the model and other hyperparameters in `code/train/config.py`.\n\n#### Step3: Training and Testing\n\n```\ncd code/train\npython master.py\n```\n\nNow, the results are stored in `train/results`.\n\n# Citation\n\n```\n@inproceedings{10.1145/3442381.3450004,\n    author = {Zhang, Xueyao and Cao, Juan and Li, Xirong and Sheng, Qiang and Zhong, Lei and Shu, Kai},\n    title = {Mining Dual Emotion for Fake News Detection},\n    year = {2021},\n    url = {https://doi.org/10.1145/3442381.3450004},\n    doi = {10.1145/3442381.3450004},\n    booktitle = {Proceedings of the Web Conference 2021},\n    pages = {3465–3476},\n    series = {WWW '21}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmsnow%2Fwww2021","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmsnow%2Fwww2021","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmsnow%2Fwww2021/lists"}