kandi background
Explore Kits

Twitter Bot Detector

by kandikits Updated: Oct 17, 2022


The Twitter bot is a program used to produce automated posts, follow Twitter users, or serve as spam to entice clicks on the Twitter microblogging service. In this project, we will use Machine Learning techniques to predict whether an account on Twitter is a Bot or a real user. We have performed a significant amount of feature engineering, along with feature extraction - selected features out of 20 helped us to identify whether an account is a bot or non-bot. Please see below a sample solution kit to jumpstart your solution on creating a Bias Detector application. To use this kit to build your own solution, scroll down to refer sections Kit Deployment Instructions and Instruction to Run. ⬇️ Download 1-Click Installer

Deployment Information

Twitter Bot Detector created using this kit is added in this section. The entire solution is available as a package to download from the source code repository.

For Windows OS, Download, extract and double-click kit installer file to install the kit. Note: Do ensure to extract the zip file before running it. The installation may take from 2 to 10 minutes based on bandwidth. 1. When you're prompted during the installation of the kit, press Y to launch the app automatically and run notebook cell by cell, by clicking on a cell and click Run button below the Menu bar. 2. To run the app manually, press N when you're prompted and locate the zip file Twitter-Bot-detection.zip 3. Extract the zip file and navigate to the directory Twitter-Bot-detection 4. Open command prompt in the extracted directory Twitter-Bot-detection and run the command jupyter notebook For other Operating System, 1. Click here to install python 2. Click here to download the repository. 3. Extract the zip file and navigate to the directory Twitter-Bot-detection 4. Open terminal in the extracted directory Twitter-Bot-detection 5. Install dependencies by executing the command pip install -r requirements.txt 6. Run the command jupyter notebook.

Development Environment

VSCode and Jupyter Notebook are used for development and debugging. Jupyter Notebook is a web based interactive environment often used for experiments, whereas VSCode is used to get a typical experience of IDE for developers. Jupyter Notebook is used for our development.

vscodeby microsoft

TypeScript star image 142184 Version:1.75.0

License: Permissive (MIT)

Visual Studio Code

Support
Quality
Security
License
Reuse

vscodeby microsoft

TypeScript star image 142184 Version:1.75.0 License: Permissive (MIT)

Visual Studio Code
Support
Quality
Security
License
Reuse

notebookby jupyter

Jupyter Notebook star image 9740 Version:v7.0.0a11

License: Others (Non-SPDX)

Jupyter Interactive Notebook

Support
Quality
Security
License
Reuse

notebookby jupyter

Jupyter Notebook star image 9740 Version:v7.0.0a11 License: Others (Non-SPDX)

Jupyter Interactive Notebook
Support
Quality
Security
License
Reuse

Exploratory Data Analysis

For extensive analysis and exploration of data, and to deal with arrays, these libraries are used. They are also used for performing scientific computation and data manipulation.

pandasby pandas-dev

Python star image 36783 Version:1.5.2

License: Permissive (BSD-3-Clause)

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more

Support
Quality
Security
License
Reuse

pandasby pandas-dev

Python star image 36783 Version:1.5.2 License: Permissive (BSD-3-Clause)

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
Support
Quality
Security
License
Reuse

numpyby numpy

Python star image 22621 Version:1.24.1

License: Permissive (BSD-3-Clause)

The fundamental package for scientific computing with Python.

Support
Quality
Security
License
Reuse

numpyby numpy

Python star image 22621 Version:1.24.1 License: Permissive (BSD-3-Clause)

The fundamental package for scientific computing with Python.
Support
Quality
Security
License
Reuse

Data Visualization

The patterns and relationships are identified by representing data visually and below libraries are used for generating visual plots of the data.

matplotlibby matplotlib

Python star image 16825 Version:3.6.2

License: No License (null)

matplotlib: plotting with Python

Support
Quality
Security
License
Reuse

matplotlibby matplotlib

Python star image 16825 Version:3.6.2 License: No License

matplotlib: plotting with Python
Support
Quality
Security
License
Reuse

seabornby mwaskom

Python star image 10314 Version:0.12.2

License: Permissive (BSD-3-Clause)

Statistical data visualization in Python

Support
Quality
Security
License
Reuse

seabornby mwaskom

Python star image 10314 Version:0.12.2 License: Permissive (BSD-3-Clause)

Statistical data visualization in Python
Support
Quality
Security
License
Reuse

Utilities

Tweepy library helps to integrate our application with Twitter.

tweepyby tweepy

Python star image 9448 Version:4.12.1

License: Permissive (MIT)

Twitter for Python!

Support
Quality
Security
License
Reuse

tweepyby tweepy

Python star image 9448 Version:4.12.1 License: Permissive (MIT)

Twitter for Python!
Support
Quality
Security
License
Reuse

Kit Solution Source

MachineLearning-Detecting-Twitter-Botsby jubins

Jupyter Notebook star image 84 Version:Current

License: Permissive (MIT)

Custom classification algorithm to sense the bots vs human on social media space like twitter

Support
Quality
Security
License
Reuse

MachineLearning-Detecting-Twitter-Botsby jubins

Jupyter Notebook star image 84 Version:Current License: Permissive (MIT)

Custom classification algorithm to sense the bots vs human on social media space like twitter
Support
Quality
Security
License
Reuse

Instruction to Run

Follow below instructions to run the solution. 1. Locate and open the Bot-Detection.ipynb notebook from the Jupyter Notebook browser window. 2. Bearer tokens are needed to use the Twitter API. 3. To obtain it, access https://developer.twitter.com/en/apps or click here register your app, and get your API keys (and tokens) 4. Under Generate Bearer Token section, replace your Bearer token in the curl URL at location of Authorization: Bearer < bearer token > For example, Authorization: Bearer AAAAAAAAAAAAAAAAAAAAAbfb3IuBi2%bS323nE%nL 5. Execute cells in the notebook by selecting Cell --> Run All from Menu bar. For your Challenge, 1. You can get recent tweets by modifying the hashtag in curl URL with query=%23< tag >.For e.g query=%23covid 2. Execute cells in the notebook by selecting Cell --> Run All from Menu bar. 3. Output will be stored in a file Output_data.csv in the location Twitter-Bot-detection directory. Output text is in csv format.

Troubleshooting

1. While running batch file, if you encounter Windows protection alert , select More info --> Run anyway 2. During kit installer, if you encounter Windows security alert, click Allow

Support

If you need help to use this kit, you can email us at kandi.support@openweaver.com or direct message us on Twitter Message @OpenWeaverInc.