{"id":35782325,"url":"https://github.com/murilobellatini/newspapers-text-mining","last_synced_at":"2026-01-07T06:05:19.508Z","repository":{"id":49713511,"uuid":"281194576","full_name":"murilobellatini/newspapers-text-mining","owner":"murilobellatini","description":"Study case with end-to-end Data Science project for classifying Newspapers' articles. From raw Data Extraction up to deployed Text Classifier inside a containerized API.","archived":false,"fork":false,"pushed_at":"2021-06-10T15:49:52.000Z","size":10320,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-08-01T13:14:03.561Z","etag":null,"topics":["api-rest","data-science","sklearn-library","text-mining","word2vec","xgboost"],"latest_commit_sha":null,"homepage":"","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/murilobellatini.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":"2020-07-20T18:23:13.000Z","updated_at":"2023-08-01T13:14:03.562Z","dependencies_parsed_at":"2022-09-14T07:51:53.034Z","dependency_job_id":null,"html_url":"https://github.com/murilobellatini/newspapers-text-mining","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/murilobellatini/newspapers-text-mining","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murilobellatini%2Fnewspapers-text-mining","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murilobellatini%2Fnewspapers-text-mining/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murilobellatini%2Fnewspapers-text-mining/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murilobellatini%2Fnewspapers-text-mining/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/murilobellatini","download_url":"https://codeload.github.com/murilobellatini/newspapers-text-mining/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/murilobellatini%2Fnewspapers-text-mining/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28233233,"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","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-rest","data-science","sklearn-library","text-mining","word2vec","xgboost"],"created_at":"2026-01-07T06:01:45.255Z","updated_at":"2026-01-07T06:05:19.503Z","avatar_url":"https://github.com/murilobellatini.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Science Project - Newspapers Text Mining \n\n\u003e Development repo of end-to-end Data Science project for extracting insights from Newspaper articles via Text Mining toolkit\n\n#### Results achieved so far\n\n1. LinearSVC Text Classifier with 82% accuracy for predicting 6 labels (from Politics to Sports) available via containerized API\n2. XGBoost Classifier with 92% accuracy for predicting unsupervised generated labels of also 6 different subjects\n\n#### Current solution in action!\n\n![NYT News Desk Classifier](/media/nyt-classifier-svclinear.gif)\n\n## Scope\n\nThe main goal of this project is to build a production ready Text Classifier wrapped inside an API in order to showcase how I personally approach Data Science problems specifically when it comes to Text Mining.\n\nTherefore I usually follow the steps below, which are explained as follows:\n\n1. ``Data Extraction``: extract newspaper articles using avaible API's ([notebooks](notebooks/extracting))\n2. ``Data Processing``: clean the data before diving in ([notebooks](notebooks/processing))\n3. ``Exploratory Data Analysis (EDA)``: draw insights via Sentiment Analysis ([notebooks](notebooks/eda))\n4. ``Modeling``: build a supervised Text Classifier and clusterize articles using GloVe Word2Vec ([notebooks](notebooks/modeling))\n5. ``Productization``: deploy Text Classifier via API end-point ([api](api))\n\n## Applied Technologies\n\nAll technologies involved in this project are described below more or less in the order of the notebooks.\n\n* `Feature Extraction`: Tfidf Vectorizer and RegEx\n* `Supervised Learning`: LinearSVC, Logistic Regression, Multinomial Naive Bayes, Random Forest and XGBoost Classifiers\n* `Clustering`: DBSCAN and K-Means\n* `Transferred Learning`: GloVe Word2Vec\n* `Dimensionality Reduction`: t-SNE\n* `Statistical Testing`: Chi Squared for words correlations to labels\n* `Model Selection`: Train Test Split and K-Fold Cross Validation\n* `API`: Data Extraction from NYT, Sentiment Analysis with TextBlob, Productization / Deployment with FastAPI\n\n\u003e **Main libraries and frameworks**: scikit-learn, xgboost, textblob, fastapi, pandas, numpy, seaborn, matplotlib, docker, docker-compose\n\n## How to run\n\n### Requirements\n\n* `python \u003e= 3.6`\n* `conda`: [Miniconda Python 3](https://docs.conda.io/en/latest/miniconda.html).\n\n### Step-by-step guide\n\n* Create `conda` environment based on `yml` file.\n\n```bash\nconda env create -f environment.yml\n```\n\n* Activate `conda` environment.\n\n```bash\nconda activate ds-env\n```\n\n* Run notebooks as you wish\n\n## Folder organization\n\n    ├── README.md                   \u003c- The top-level README for scientists and engineers.\n    │\n    ├── api                         \u003c- API folder with containerized Text Classifier\n    │\n    ├── data                        \u003c- Data folder (versioned in the cloud, not with git)\n    │   ├── external                \u003c- Data from third party sources.\n    │   ├── interim                 \u003c- Intermediate data that has been transformed.\n    │   ├── processed               \u003c- The final, canonical data sets for modeling.\n    │   └── raw                     \u003c- The original, immutable data dump.\n    │\n    ├── models                      \u003c- Trained and serialized models (versioned in the cloud, not with git)\n    │\n    ├── notebooks                   \u003c- Notebooks folder \n    │\n    ├── credentials                 \u003c- Required credentials stored locally (ignored on repo for security issues)\n    │\n    ├── reports                     \u003c- Code-free, stakeholders-ready reports such as markdown files\n    │   ├── figures                 \u003c- Graphics and figures to be used in reporting\n    │   └── data                    \u003c- Output data generated by models or analyses\n    │\n    ├── environment.yml             \u003c- The conda env file for reproducing the environment\n    │\n    ├── setup.py                    \u003c- makes 'src' installable so it can be imported\n    │\n    └── src                         \u003c- Reusable Python code\n        ├── __init__.py             \u003c- Makes src a Python module\n        └── ...                     \u003c- Further modules as work in progress\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurilobellatini%2Fnewspapers-text-mining","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmurilobellatini%2Fnewspapers-text-mining","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmurilobellatini%2Fnewspapers-text-mining/lists"}