{"id":19626684,"url":"https://github.com/linggarm/covid-19-tweets-classification","last_synced_at":"2026-05-11T07:47:04.078Z","repository":{"id":145513486,"uuid":"375786931","full_name":"LinggarM/Covid-19-Tweets-Classification","owner":"LinggarM","description":"Classification of Covid-19 Tweets using Multinomial Naive Bayes and TF-IDF Vectorizer to categorize tweets about Covid-19 into three main classes","archived":false,"fork":false,"pushed_at":"2023-12-24T20:47:21.000Z","size":536,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T20:13:49.138Z","etag":null,"topics":["artificial-intelligence","classification","covid-19","data-science","google-colab","machine-learning","multinomial-naive-bayes","naive-bayes","natural-language-processing","nlp","python","sastrawi","scikit-learn","text-classification","tf-idf","tweepy","tweets","tweets-classification","twitter","vaccine"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/LinggarM.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":"2021-06-10T18:03:15.000Z","updated_at":"2023-12-27T20:20:34.000Z","dependencies_parsed_at":"2023-12-24T09:27:47.965Z","dependency_job_id":"6c011804-ca8b-4873-b54e-c1d36026674f","html_url":"https://github.com/LinggarM/Covid-19-Tweets-Classification","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LinggarM/Covid-19-Tweets-Classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinggarM%2FCovid-19-Tweets-Classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinggarM%2FCovid-19-Tweets-Classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinggarM%2FCovid-19-Tweets-Classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinggarM%2FCovid-19-Tweets-Classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinggarM","download_url":"https://codeload.github.com/LinggarM/Covid-19-Tweets-Classification/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinggarM%2FCovid-19-Tweets-Classification/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263291381,"owners_count":23443747,"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":["artificial-intelligence","classification","covid-19","data-science","google-colab","machine-learning","multinomial-naive-bayes","naive-bayes","natural-language-processing","nlp","python","sastrawi","scikit-learn","text-classification","tf-idf","tweepy","tweets","tweets-classification","twitter","vaccine"],"created_at":"2024-11-11T11:47:19.558Z","updated_at":"2026-05-11T07:47:04.035Z","avatar_url":"https://github.com/LinggarM.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Covid-19-Tweets-Classification\n**Classification of Covid-19 Tweets** using **Multinomial Naive Bayes** and **TF-IDF Vectorizer** to categorize tweets into **three** main classes: **\"Vaccine\"** (Vaksin), **\"Prevention and treatment of covid-19\"** (Pencegahan dan pengobatan), and **\"Current development of covid-19 in Indonesia\"** (Perkembangan covid di Indonesia).\n\n## About the Project\n\nThis project is a major assignment project for the first semester of the **natural language processing** course. The objective of this task is to crawl data related to COVID-19 on the Twitter platform with a minimum amount of data per class of 100, then classify the text based on the data obtained in these 3 classes.\n\nThe 3 classes used in this project are:\n- **\"Vaccine\"** (Vaksin),\n- **\"Prevention and treatment of covid-19\"** (Pencegahan dan pengobatan), and\n- **\"Current development of covid-19 in Indonesia\"** (Perkembangan covid di Indonesia)\n\nIn this project, we use **Multinomial Naive Bayes** algorithm to perform text classification and **TF-IDF Vectorizer** as Word Embedding (to convert text data into vectors).\n\n## Objectives/ Problems\n\n**Covid-19** is a global virus pandemic affecting people worldwide. The virus spreads quickly through droplets from infected individuals. The Covid-19 pandemic has significantly affected societal life. Discussions range from health protocols and symptoms to daily reports of cases and vaccine development. Social and economic consequences are also widely discussed.\n\nTwitter, a major social media platform, is a prominent space for discussions. Users share information through tweets, contributing to a vast array of discussions on COVID-19, like **health protocols, symptoms, daily case reports, vaccine development,** and **socio-economic impacts**. Due to the large volume of discussions on Twitter, a classification system is essential. This system helps analyze and understand the prevalent topics related to the Covid-19 pandemic.\n\n## Technology Used\n* Python\n* Pandas\n* Matplotlib\n* Seaborn\n* Scikit-learn\n* Sastrawi\n* Tweepy\n\n## Notebook File\n* [covid-19-tweets-classification.ipynb](notebooks/covid-19-tweets-classification.ipynb)\n\n## Workflow\n\n### Data Collection\n  - The dataset used in this project comprises tweet data acquired from the **Twitter** platform using the **Tweepy** library. The data was collected based on the following keywords:\n    - **\"Vaccine\"** (Vaksin),\n      - \"vaksin astrazeneca\"\n      - \"vaksin sinovac\"\n      - \"vaksin sinopharm\"\n    - **\"Prevention and treatment of covid-19\"** (Pencegahan dan pengobatan), and\n      - \"pencegahan covid-19\"\n      - \"pengobatan covid-19\"\n      - \"pencegahan corona\"\n      - \"pengobatan corona\"\n    - **\"Current development of covid-19 in Indonesia\"** (Perkembangan covid di Indonesia)\n      - \"perkembangan covid-19\"\n      - \"covid-19 di Indonesia\"\n      - \"covid-19 berkembang\"\n  - **The quantity of collected data is:**\n    - \"Vaccine\": **115** Tweets\n    - \"Prevention and treatment of covid-19\": **155** Tweets\n    - \"Current development of covid-19 in Indonesia\": **147** Tweets\n    - Total: **417** tweets\n  - **Data distribution:**\n\n    ![images/data_distribution.png](images/data_distribution.png)\n\n### Data Preprocessing\n  The data preprocessing steps applied to the data include:\n  - Remove **hashtag, @user, and hyperlink** from the tweet\n  - **Stopword removal** using **Sastrawi** library\n  - Train the **TF-IDF Vectorizer** model\n\n### Data Splitting\n  - The data is split into **training data** and **testing data** with a ratio of 0.2, signifying **80% for training data** and **20% for testing data**. The random_state variable is set to 0.\n\n### Model Building \u0026 Training\n  - The model is trained using the **Multinomial Naive Bayes** algorithm\n  - The trained model is saved to: [models/MNB_model.sav](models/MNB_model.sav)\n\n### Model Evaluation\n  - Confusion Matrix:\n\n    ![images/conf_mat.png](images/conf_mat.png)\n\n  - Classification Report\n    |                               | Precision | Recall | F1-Score | Support |\n    |-------------------------------|-----------|--------|----------|---------|\n    | Pencegahan atau Pengobatan    |   0.90    |  0.93  |   0.91   |   28    |\n    | Perkembangan COVID-19         |   0.97    |  0.90  |   0.93   |   31    |\n    | Vaccine                       |   0.92    |  0.96  |   0.94   |   25    |\n    | Accuracy                      |           |        |   0.93   |   84    |\n    | Macro Avg                     |   0.93    |  0.93  |   0.93   |   84    |\n    | Weighted Avg                  |   0.93    |  0.93  |   0.93   |   84    |\n\n  \n  - Accuracy Score:\n    - 0.9285714285714286 (**92.86%**)\n\n## Publication\n* [Klasifikasi Tweet Mengenai COVID-19.pdf](docs/PBA%20Tugas%20Besar%20-%20Kelompok%202.pdf)\n\n## Contributors\n* [Linggar Maretva Cendani](https://github.com/LinggarM) - [linggarmc@gmail.com](mailto:linggarmc@gmail.com)\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinggarm%2Fcovid-19-tweets-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinggarm%2Fcovid-19-tweets-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinggarm%2Fcovid-19-tweets-classification/lists"}