{"action":"created","comment":{"url":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/comments/204232348","pull_request_review_id":139279846,"id":204232348,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDIzMjM0OA==","diff_hunk":"@@ -33,4 +33,62 @@ The number of vowels and consonants of screen_name and name is counted, and it i\n \n ###### Verification of quantity of strings of letters\n \n-The screen_name and name are separated into strings only consisting of letters, if you have more than one string there are numbers or symbols in between could be a random name.\n\\ No newline at end of file\n+The screen_name and name are separated into strings only consisting of letters, if you have more than one string there are numbers or symbols in between could be a random name.\n+\n+### Heuristic: Fake Promoter\n+\n+Heuristic that identifies accounts that are promotioning other accounts exhibiting bot-like behaviour.\n+\n+#### Preparation\n+\n+This heuristic uses a db structure that has stored, for each user, its bot_detector_pbb(1) and, for each user interacted by the former, its screen name and bot_detector_pbb.\n+Before doing any computations, it fetches a sample of one(2) user document from the database, and if it already has the attribute 'bot_detector_pbb', it is assumed that it and all the user documents have the described structure. If it doesn't, its and its interacted users' bot_detector_pbbs are calculated and stored.\n+Since performing the preparations for this computations for every user may imply doing an extra computation for every user that she/he started an interaction with, an upper limit is set on the number of the interacted users that are going to be taken into account for the update process (NUM_INTERACTED_USERS). It can be set in the 'fake_promoter.py' file, 'modify_db' function.\n+In the same file and function, the number of documents to be updated can also be set (NUM_USERS). This in case it is desired to update the db in multiple passes. (Note that it's not the same constant than that of the 'bot_detector.py' file).\n+\n+#### Implementation\n+\n+The heuristic consists of evaluating the interactions (RTs, Quotes, Mentions, etc.) generated by the user being analyzed and doing some mathematical computations about them.\n+Since performing the preparations for this computations for every user may imply doing an extra computation for every user that she/he started an interaction with, and since not all interacted users may be stored in the document for each user, an upper limit is set on the number of the interacted users that are going to be taken into account for the computations (NUM_INTERACTED_USERS). It can be set in the 'bot_detector.py' file. Note that it's not the same constant than that of the 'fake_promoter.py' file, and it cannot be greater than the maximum number of interacted users stored in the db for each user. When describing the heuristic, this detail is ignored for simplicity purposes, but this must be taken into account when executing the script.\n+\n+For illustrating how the heuristic works, let's take for example the user CESARSANCHEZ533.\n+\n+Assume that he's the user being analyzed.\n+First, the interactions and users interacted by him are fetched, using the 'NetworkAnalyzer' class from the 'network_analysis' module(3). The results are better if the synthesis of the interactions of a user is ordered decreasingly by the number of interactions started with them, so its iterated in this order.\n+Also the synthesis of the interacted users with the bot_detector_pbb of each one of them is fetched.\n+The exact next steps depends on the specific method of the heuristic, and are described below. For now suffice it say that a score is calculated, and if it trespassess a Threshold, then the heuristic returns 1. If not, it returns 0.","path":"README.md","position":29,"original_position":29,"commit_id":"80071d348226cbb0d6d5044a086fb4bd305802c4","original_commit_id":"80071d348226cbb0d6d5044a086fb4bd305802c4","user":{"login":"josueibarra95","id":20470649,"node_id":"MDQ6VXNlcjIwNDcwNjQ5","avatar_url":"https://avatars1.githubusercontent.com/u/20470649?v=4","gravatar_id":"","url":"https://api.github.com/users/josueibarra95","html_url":"https://github.com/josueibarra95","followers_url":"https://api.github.com/users/josueibarra95/followers","following_url":"https://api.github.com/users/josueibarra95/following{/other_user}","gists_url":"https://api.github.com/users/josueibarra95/gists{/gist_id}","starred_url":"https://api.github.com/users/josueibarra95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josueibarra95/subscriptions","organizations_url":"https://api.github.com/users/josueibarra95/orgs","repos_url":"https://api.github.com/users/josueibarra95/repos","events_url":"https://api.github.com/users/josueibarra95/events{/privacy}","received_events_url":"https://api.github.com/users/josueibarra95/received_events","type":"User","site_admin":false},"body":"Los thresholds los establece el usuario modificando las constantes en la función 'promoter_user_thresholds' en 'fake_promoter.py'. Yo usé valores de prueba nomás, pero se toman parámetros considerados \"normales\" o en el límite de lo normal. Por ejemplo puedo considerar normal que una cuenta tenga hasta 50 interacciones con una cuenta de twitter con cuentas de bot_detector_pbb promedio de 0.50, y de ahí se saca el threshold para el método 0. Análogamente se pueden calcular los thresholds para los otros métodos","created_at":"2018-07-22T08:33:10Z","updated_at":"2018-07-22T08:33:11Z","html_url":"https://github.com/ParticipaPY/politic-bots/pull/32#discussion_r204232348","pull_request_url":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/32","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/comments/204232348"},"html":{"href":"https://github.com/ParticipaPY/politic-bots/pull/32#discussion_r204232348"},"pull_request":{"href":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/32"}},"in_reply_to_id":204215141},"pull_request":{"url":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/32","id":191926655,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxOTI2NjU1","html_url":"https://github.com/ParticipaPY/politic-bots/pull/32","diff_url":"https://github.com/ParticipaPY/politic-bots/pull/32.diff","patch_url":"https://github.com/ParticipaPY/politic-bots/pull/32.patch","issue_url":"https://api.github.com/repos/ParticipaPY/politic-bots/issues/32","number":32,"state":"open","locked":false,"title":"Add promoter-user heuristic","user":{"login":"josueibarra95","id":20470649,"node_id":"MDQ6VXNlcjIwNDcwNjQ5","avatar_url":"https://avatars1.githubusercontent.com/u/20470649?v=4","gravatar_id":"","url":"https://api.github.com/users/josueibarra95","html_url":"https://github.com/josueibarra95","followers_url":"https://api.github.com/users/josueibarra95/followers","following_url":"https://api.github.com/users/josueibarra95/following{/other_user}","gists_url":"https://api.github.com/users/josueibarra95/gists{/gist_id}","starred_url":"https://api.github.com/users/josueibarra95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josueibarra95/subscriptions","organizations_url":"https://api.github.com/users/josueibarra95/orgs","repos_url":"https://api.github.com/users/josueibarra95/repos","events_url":"https://api.github.com/users/josueibarra95/events{/privacy}","received_events_url":"https://api.github.com/users/josueibarra95/received_events","type":"User","site_admin":false},"body":"Add heuristic that estimates if a twitter account is promoting bot accounts. Resolves #27 @joausaga ","created_at":"2018-06-01T03:39:27Z","updated_at":"2018-07-22T08:33:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d98894f032170ac49591e539e4a252956c3930e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/32/commits","review_comments_url":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/32/comments","review_comment_url":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ParticipaPY/politic-bots/issues/32/comments","statuses_url":"https://api.github.com/repos/ParticipaPY/politic-bots/statuses/80071d348226cbb0d6d5044a086fb4bd305802c4","head":{"label":"ParticipaPY:ticket#27","ref":"ticket#27","sha":"80071d348226cbb0d6d5044a086fb4bd305802c4","user":{"login":"ParticipaPY","id":18314431,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MzE0NDMx","avatar_url":"https://avatars1.githubusercontent.com/u/18314431?v=4","gravatar_id":"","url":"https://api.github.com/users/ParticipaPY","html_url":"https://github.com/ParticipaPY","followers_url":"https://api.github.com/users/ParticipaPY/followers","following_url":"https://api.github.com/users/ParticipaPY/following{/other_user}","gists_url":"https://api.github.com/users/ParticipaPY/gists{/gist_id}","starred_url":"https://api.github.com/users/ParticipaPY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParticipaPY/subscriptions","organizations_url":"https://api.github.com/users/ParticipaPY/orgs","repos_url":"https://api.github.com/users/ParticipaPY/repos","events_url":"https://api.github.com/users/ParticipaPY/events{/privacy}","received_events_url":"https://api.github.com/users/ParticipaPY/received_events","type":"Organization","site_admin":false},"repo":{"id":113185036,"node_id":"MDEwOlJlcG9zaXRvcnkxMTMxODUwMzY=","name":"politic-bots","full_name":"ParticipaPY/politic-bots","owner":{"login":"ParticipaPY","id":18314431,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MzE0NDMx","avatar_url":"https://avatars1.githubusercontent.com/u/18314431?v=4","gravatar_id":"","url":"https://api.github.com/users/ParticipaPY","html_url":"https://github.com/ParticipaPY","followers_url":"https://api.github.com/users/ParticipaPY/followers","following_url":"https://api.github.com/users/ParticipaPY/following{/other_user}","gists_url":"https://api.github.com/users/ParticipaPY/gists{/gist_id}","starred_url":"https://api.github.com/users/ParticipaPY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParticipaPY/subscriptions","organizations_url":"https://api.github.com/users/ParticipaPY/orgs","repos_url":"https://api.github.com/users/ParticipaPY/repos","events_url":"https://api.github.com/users/ParticipaPY/events{/privacy}","received_events_url":"https://api.github.com/users/ParticipaPY/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ParticipaPY/politic-bots","description":"Tools and algorithms to analyze Paraguayan Tweets in times of elections","fork":false,"url":"https://api.github.com/repos/ParticipaPY/politic-bots","forks_url":"https://api.github.com/repos/ParticipaPY/politic-bots/forks","keys_url":"https://api.github.com/repos/ParticipaPY/politic-bots/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ParticipaPY/politic-bots/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ParticipaPY/politic-bots/teams","hooks_url":"https://api.github.com/repos/ParticipaPY/politic-bots/hooks","issue_events_url":"https://api.github.com/repos/ParticipaPY/politic-bots/issues/events{/number}","events_url":"https://api.github.com/repos/ParticipaPY/politic-bots/events","assignees_url":"https://api.github.com/repos/ParticipaPY/politic-bots/assignees{/user}","branches_url":"https://api.github.com/repos/ParticipaPY/politic-bots/branches{/branch}","tags_url":"https://api.github.com/repos/ParticipaPY/politic-bots/tags","blobs_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/refs{/sha}","trees_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ParticipaPY/politic-bots/statuses/{sha}","languages_url":"https://api.github.com/repos/ParticipaPY/politic-bots/languages","stargazers_url":"https://api.github.com/repos/ParticipaPY/politic-bots/stargazers","contributors_url":"https://api.github.com/repos/ParticipaPY/politic-bots/contributors","subscribers_url":"https://api.github.com/repos/ParticipaPY/politic-bots/subscribers","subscription_url":"https://api.github.com/repos/ParticipaPY/politic-bots/subscription","commits_url":"https://api.github.com/repos/ParticipaPY/politic-bots/commits{/sha}","git_commits_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/commits{/sha}","comments_url":"https://api.github.com/repos/ParticipaPY/politic-bots/comments{/number}","issue_comment_url":"https://api.github.com/repos/ParticipaPY/politic-bots/issues/comments{/number}","contents_url":"https://api.github.com/repos/ParticipaPY/politic-bots/contents/{+path}","compare_url":"https://api.github.com/repos/ParticipaPY/politic-bots/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ParticipaPY/politic-bots/merges","archive_url":"https://api.github.com/repos/ParticipaPY/politic-bots/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ParticipaPY/politic-bots/downloads","issues_url":"https://api.github.com/repos/ParticipaPY/politic-bots/issues{/number}","pulls_url":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls{/number}","milestones_url":"https://api.github.com/repos/ParticipaPY/politic-bots/milestones{/number}","notifications_url":"https://api.github.com/repos/ParticipaPY/politic-bots/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ParticipaPY/politic-bots/labels{/name}","releases_url":"https://api.github.com/repos/ParticipaPY/politic-bots/releases{/id}","deployments_url":"https://api.github.com/repos/ParticipaPY/politic-bots/deployments","created_at":"2017-12-05T13:22:44Z","updated_at":"2018-06-28T01:54:58Z","pushed_at":"2018-07-21T07:44:58Z","git_url":"git://github.com/ParticipaPY/politic-bots.git","ssh_url":"git@github.com:ParticipaPY/politic-bots.git","clone_url":"https://github.com/ParticipaPY/politic-bots.git","svn_url":"https://github.com/ParticipaPY/politic-bots","homepage":"https://www.participa.org.py","size":5541,"stargazers_count":14,"watchers_count":14,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":5,"watchers":14,"default_branch":"master"}},"base":{"label":"ParticipaPY:master","ref":"master","sha":"5a606c7345257cbb9faefec71bece80644e7f9e2","user":{"login":"ParticipaPY","id":18314431,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MzE0NDMx","avatar_url":"https://avatars1.githubusercontent.com/u/18314431?v=4","gravatar_id":"","url":"https://api.github.com/users/ParticipaPY","html_url":"https://github.com/ParticipaPY","followers_url":"https://api.github.com/users/ParticipaPY/followers","following_url":"https://api.github.com/users/ParticipaPY/following{/other_user}","gists_url":"https://api.github.com/users/ParticipaPY/gists{/gist_id}","starred_url":"https://api.github.com/users/ParticipaPY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParticipaPY/subscriptions","organizations_url":"https://api.github.com/users/ParticipaPY/orgs","repos_url":"https://api.github.com/users/ParticipaPY/repos","events_url":"https://api.github.com/users/ParticipaPY/events{/privacy}","received_events_url":"https://api.github.com/users/ParticipaPY/received_events","type":"Organization","site_admin":false},"repo":{"id":113185036,"node_id":"MDEwOlJlcG9zaXRvcnkxMTMxODUwMzY=","name":"politic-bots","full_name":"ParticipaPY/politic-bots","owner":{"login":"ParticipaPY","id":18314431,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MzE0NDMx","avatar_url":"https://avatars1.githubusercontent.com/u/18314431?v=4","gravatar_id":"","url":"https://api.github.com/users/ParticipaPY","html_url":"https://github.com/ParticipaPY","followers_url":"https://api.github.com/users/ParticipaPY/followers","following_url":"https://api.github.com/users/ParticipaPY/following{/other_user}","gists_url":"https://api.github.com/users/ParticipaPY/gists{/gist_id}","starred_url":"https://api.github.com/users/ParticipaPY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParticipaPY/subscriptions","organizations_url":"https://api.github.com/users/ParticipaPY/orgs","repos_url":"https://api.github.com/users/ParticipaPY/repos","events_url":"https://api.github.com/users/ParticipaPY/events{/privacy}","received_events_url":"https://api.github.com/users/ParticipaPY/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ParticipaPY/politic-bots","description":"Tools and algorithms to analyze Paraguayan Tweets in times of elections","fork":false,"url":"https://api.github.com/repos/ParticipaPY/politic-bots","forks_url":"https://api.github.com/repos/ParticipaPY/politic-bots/forks","keys_url":"https://api.github.com/repos/ParticipaPY/politic-bots/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ParticipaPY/politic-bots/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ParticipaPY/politic-bots/teams","hooks_url":"https://api.github.com/repos/ParticipaPY/politic-bots/hooks","issue_events_url":"https://api.github.com/repos/ParticipaPY/politic-bots/issues/events{/number}","events_url":"https://api.github.com/repos/ParticipaPY/politic-bots/events","assignees_url":"https://api.github.com/repos/ParticipaPY/politic-bots/assignees{/user}","branches_url":"https://api.github.com/repos/ParticipaPY/politic-bots/branches{/branch}","tags_url":"https://api.github.com/repos/ParticipaPY/politic-bots/tags","blobs_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/refs{/sha}","trees_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ParticipaPY/politic-bots/statuses/{sha}","languages_url":"https://api.github.com/repos/ParticipaPY/politic-bots/languages","stargazers_url":"https://api.github.com/repos/ParticipaPY/politic-bots/stargazers","contributors_url":"https://api.github.com/repos/ParticipaPY/politic-bots/contributors","subscribers_url":"https://api.github.com/repos/ParticipaPY/politic-bots/subscribers","subscription_url":"https://api.github.com/repos/ParticipaPY/politic-bots/subscription","commits_url":"https://api.github.com/repos/ParticipaPY/politic-bots/commits{/sha}","git_commits_url":"https://api.github.com/repos/ParticipaPY/politic-bots/git/commits{/sha}","comments_url":"https://api.github.com/repos/ParticipaPY/politic-bots/comments{/number}","issue_comment_url":"https://api.github.com/repos/ParticipaPY/politic-bots/issues/comments{/number}","contents_url":"https://api.github.com/repos/ParticipaPY/politic-bots/contents/{+path}","compare_url":"https://api.github.com/repos/ParticipaPY/politic-bots/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ParticipaPY/politic-bots/merges","archive_url":"https://api.github.com/repos/ParticipaPY/politic-bots/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ParticipaPY/politic-bots/downloads","issues_url":"https://api.github.com/repos/ParticipaPY/politic-bots/issues{/number}","pulls_url":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls{/number}","milestones_url":"https://api.github.com/repos/ParticipaPY/politic-bots/milestones{/number}","notifications_url":"https://api.github.com/repos/ParticipaPY/politic-bots/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ParticipaPY/politic-bots/labels{/name}","releases_url":"https://api.github.com/repos/ParticipaPY/politic-bots/releases{/id}","deployments_url":"https://api.github.com/repos/ParticipaPY/politic-bots/deployments","created_at":"2017-12-05T13:22:44Z","updated_at":"2018-06-28T01:54:58Z","pushed_at":"2018-07-21T07:44:58Z","git_url":"git://github.com/ParticipaPY/politic-bots.git","ssh_url":"git@github.com:ParticipaPY/politic-bots.git","clone_url":"https://github.com/ParticipaPY/politic-bots.git","svn_url":"https://github.com/ParticipaPY/politic-bots","homepage":"https://www.participa.org.py","size":5541,"stargazers_count":14,"watchers_count":14,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":5,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/32"},"html":{"href":"https://github.com/ParticipaPY/politic-bots/pull/32"},"issue":{"href":"https://api.github.com/repos/ParticipaPY/politic-bots/issues/32"},"comments":{"href":"https://api.github.com/repos/ParticipaPY/politic-bots/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ParticipaPY/politic-bots/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/ParticipaPY/politic-bots/statuses/80071d348226cbb0d6d5044a086fb4bd305802c4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"josueibarra95"}}