{"id":15911175,"url":"https://github.com/bartekpog/messenger-analysis","last_synced_at":"2025-03-22T11:30:58.578Z","repository":{"id":37637789,"uuid":"260896285","full_name":"BartekPog/Messenger-analysis","owner":"BartekPog","description":"Messenger chat analyzer. Take a look at the in-depth study of your chat history.","archived":false,"fork":false,"pushed_at":"2023-07-06T22:00:34.000Z","size":33836,"stargazers_count":4,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T10:51:29.151Z","etag":null,"topics":["algorithms","data-science","data-visualization","exploration","messenger","python","text-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","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/BartekPog.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-03T11:28:57.000Z","updated_at":"2022-12-25T07:11:02.000Z","dependencies_parsed_at":"2024-10-28T13:41:59.796Z","dependency_job_id":null,"html_url":"https://github.com/BartekPog/Messenger-analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BartekPog%2FMessenger-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BartekPog%2FMessenger-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BartekPog%2FMessenger-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BartekPog%2FMessenger-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BartekPog","download_url":"https://codeload.github.com/BartekPog/Messenger-analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244951165,"owners_count":20537331,"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":["algorithms","data-science","data-visualization","exploration","messenger","python","text-analysis"],"created_at":"2024-10-06T15:40:30.018Z","updated_at":"2025-03-22T11:30:53.563Z","avatar_url":"https://github.com/BartekPog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Messenger Report Generator\n\n![Number of messages in chats plot](sample_figures/messages-in-chats.png)\n\nFor many of us, Messenger is the main communicator. It contains a lot of information about ourselves and our relationships. This repository contains a script that generates a bunch of charts about your messages history.\n\n##### Charts generated by the script:\n\n- messages count rank\n- overall activity over time\n- average activity over a day\n- average activity over a week\n- average message lengths in _significant_ chats\n- word clouds of important phrases in chats\n- activity over time per chat\n- messages length distributions in _significant_ chats\n- language diversity rank _(experimental)_\n\n## Table of contents\n\n1. [Usage](#usage)\n   - [Collecting data](#collecting-data)\n   - [Setting up the script](#setting-up-the-script)\n   - [Running script](#running-script)\n1. [Examples](#examples)\n   - [Activity in chats plot](#activity-in-chats-plot)\n   - [Average messages length in significant chats](#average-messages-length-in-significant-chats)\n   - [Chat keyword cloud](#chat-keyword-cloud)\n   - [Language diversity rank](#language-diversity-rank)\n1. [Contribute](#contribute)\n\n## Usage\n\n#### Collecting data\n\nFacebook enables its users to get their Messenger **messages history**.\n\nData requesting steps:\n\n1. Go to facebook settings and then proceed to [downloading your data](https://www.facebook.com/dyi/?referrer=yfi_settings).\n1. Deselect all data and select only **Messages**\n1. Choose data format to **JSON**\n1. Choose the multimedia quality to **low** (all the media in chats are downloaded as well but they are omitted by the script)\n1. Accept data request\n\nPreparing data file shall not take more than 24h. You will be notified when your file is ready.\n\n#### Setting up the script\n\nAfter **cloning** this repository place the downloaded zip in `zips` subdirectory and setup the virtual environment for **python 3.8**. \n\nOn Linux you can use [virtualenv](https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/26/python-virtual-env/).\n\nOn Windows you have to use `conda` virtual environment. You can use either \n - [Miniconda](https://docs.conda.io/en/latest/miniconda.html) - install and run cmd via `Anaconda Prompt (miniconda3)` and `cd` to the cloned repository directory \n - [Anaconda](https://www.anaconda.com/products/individual#windows) - install and run `Anaconda Navigator (anaconda3)`, then go to **Environments**, setup new environment, start it via cmd and `cd` to the repository directory.\n\n \nAfter setting up the environment and opening the repository directory run:\n\n```bash\npip install -r requirements.txt\npython -m spacy download pl_core_news_md\npython -m spacy download en_core_web_sm\n```\n\nIn `params.json` you shall set your `\"user\"`, `\"language\"` and `\"timezone\"`.\n\n```JSON\n{\n  \"user\": \"Bartek Pogod\",\n  \"language\": \"polish\",\n  \"timezone\": \"Europe/Warsaw\",\n\n  [...]\n}\n```\n\n#### Running script\n\nIf all is set up properly the charts shall be generated after running:\n\n```bash\npython messages_analysis.py\n```\n\nAfter a couple of minutes, all the plots shall appear in `figures` folder (or other specified in `params.json`).\n\n## Examples:\n\n#### Activity in chats plot\n\nThis plot can show how your relationships changed over time. It can show when your relationships started to form or to collapse. The lines are smoothened to increase visibility.\n![Activity in chats](sample_figures/activity-for-most-frequent-non-group-chats.png)\n\n#### Average messages length in significant chats\n\nThis chart can say a lot about the interactions. Usually, longer messages are more formal, possibly more personal. It says _\"in significant chats\"_, because some chats have too few messages to be considered important.\n![Message length rank](sample_figures/average-message-length-in-significant-chats.png)\n\n#### Chat keyword cloud\n\nIt is generated using [TextRank algorithm](https://www.aclweb.org/anthology/W04-3252.pdf). Size of the words shall represent the importance of them in a chat. The example chart is in polish, because it is the first language of the author.\n![Chat wordcloud](sample_figures/keywords1.png)\n\n#### Language diversity rank\n\nLanguage diversity score shall represent how diverse is the vocabulary of the speaker in a chat.\n\nTo calculate the score the messages sent by a chat participant are prepared - numbers, punctuation and entities are removed. All the words are lemmatized, to get the word base form. Then the messages sent by one person are divided into batches of 2000 words. For every 2000 words, there is calculated the quotient of lemmas number and batch size (2000). The final score is a mean of those quotients.\n![Language diversity rank](sample_figures/language-diversity-rank.png)\n\n## Contribute\n\nThe possibilities are almost endless. Take a look at the **issues** tab to write your own ideas or see how you can help! Let's make something great :D.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartekpog%2Fmessenger-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartekpog%2Fmessenger-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartekpog%2Fmessenger-analysis/lists"}