All Projects → machine-learning-apps → Issue Label Bot

machine-learning-apps / Issue Label Bot

Licence: mit
Code For The Issue Label Bot, an App that automatically labels issues using machine learning, available on the GitHub Marketplace. This is also code for the blog article: "How to automate tasks on GitHub with machine learning for fun and profit"

Projects that are alternatives of or similar to Issue Label Bot

Python Articles
Monthly Series - Top 10 Python Articles
Stars: ✭ 288 (-1.37%)
Mutual labels:  data-science, flask
Bowtie
Create a dashboard with python!
Stars: ✭ 724 (+147.95%)
Mutual labels:  data-science, flask
Flog
A Simple Blog Powered by Flask
Stars: ✭ 150 (-48.63%)
Mutual labels:  flask, bootstrap
Weeklyreport
基于Flask的开源周报系统,快速docker部署
Stars: ✭ 102 (-65.07%)
Mutual labels:  flask, bootstrap
Dtale
Visualizer for pandas data structures
Stars: ✭ 2,864 (+880.82%)
Mutual labels:  data-science, flask
Tedivms Flask
Flask starter app with celery, bootstrap, and docker environment
Stars: ✭ 142 (-51.37%)
Mutual labels:  flask, bootstrap
Slapdash
Boilerplate for bootstrapping scalable multi-page Dash applications
Stars: ✭ 225 (-22.95%)
Mutual labels:  flask, bootstrap
Dfile
[Python + Flask] DFile: A fancy S3-based file sharing mode
Stars: ✭ 79 (-72.95%)
Mutual labels:  flask, scss
Labeled Tweet Generator
Search for tweets and download the data labeled with its polarity in CSV format
Stars: ✭ 111 (-61.99%)
Mutual labels:  data-science, flask
Superset
Apache Superset is a Data Visualization and Data Exploration Platform
Stars: ✭ 42,634 (+14500.68%)
Mutual labels:  data-science, flask
Booklibrary
📚Simple Book library application written on flask with SQLite database.
Stars: ✭ 98 (-66.44%)
Mutual labels:  flask, bootstrap
Dash
Analytical Web Apps for Python, R, Julia, and Jupyter. No JavaScript Required.
Stars: ✭ 15,592 (+5239.73%)
Mutual labels:  data-science, flask
Flaskdash
Flask starter app featuring CoreUI and the FlaskUser module.
Stars: ✭ 90 (-69.18%)
Mutual labels:  flask, bootstrap
Upload Demo
Uploading a large file by fragmentation, powered by Flask and WebUploader.
Stars: ✭ 144 (-50.68%)
Mutual labels:  flask, bootstrap
Job Web Demo
Python Web 实战项目,Flask + Jinja2 + Bootstrap 开发的招聘网站
Stars: ✭ 87 (-70.21%)
Mutual labels:  flask, bootstrap
Ssis Dashboard
HTML5 SQL Server Integration Services Dashboard
Stars: ✭ 206 (-29.45%)
Mutual labels:  flask, bootstrap
Databook
A facebook for data
Stars: ✭ 26 (-91.1%)
Mutual labels:  flask, bootstrap
Swarmops
Manage swarm clusters to provide a more concise and compact intermediate layer web application with swarm ui.
Stars: ✭ 63 (-78.42%)
Mutual labels:  flask, bootstrap
Phormatics
Using A.I. and computer vision to build a virtual personal fitness trainer. (Most Startup-Viable Hack - HackNYU2018)
Stars: ✭ 79 (-72.95%)
Mutual labels:  data-science, flask
Delbot
It understands your voice commands, searches news and knowledge sources, and summarizes and reads out content to you.
Stars: ✭ 191 (-34.59%)
Mutual labels:  data-science, flask

Python 3.6 License: MIT Install App

⚠️ This project has been deprecated, you can still view the code, but we have taken down the bot because of related infrastructure costs

Code for: "How to automate tasks on GitHub with machine learning for fun and profit"

Table of Contents

Original Authors: @hamelsmu, @inc0, @jlewi

Issue Label Bot

Install this app from the GitHub marketplace

A GitHub App powered by machine learning, written in Python. A discussion of the motivation for building this app is described in this blog post.

When an issue is opened, the bot predicts if the label should be a: feature request, bug or question and applies a label automatically if appropriate. Here is a screenshot of the bot in action:

alt text

More examples can be viewed on our app's homepage. It should be noted that the bot may not apply any label in circumstances where the prediction is uncertain. See the disclaimers section for more caveats.

Important links

  • Issue Label Bot homepage. Provides a way to view example predictions as well as other information regarding this bot.
  • GitHub App page for Issue Label Bot, where you can install the app. See disclaimers below before installing.

Files

  • /notebooks: contains notebooks on how to train the model and interact with the GitHub API using a Python client.
  • /flask_app: code for a flask app that listens for GitHub issue events and responds with predictions. This is the main application that the user will interact with.
  • /argo: the code in this directory relates to the construction of Argo ML Pipelines for training and deploying ML workflows.
  • /deployment: This directory contains files that are helpful in deploying the app.

Running This Code

Prerequisites

To utilize the code in this repository, you will need to register a GitHub App of your own and install this app on your desired repositories and store authentication secrets.

First, walk through the prerequisites section of this getting started guide except "The Ruby programming language" section as we will be using Python instead as the client that interfaces with the GitHub API.

Second, setup your development environment. Make sure you create a Webhook secret, even though this step is optional.

Next, set up a Postgres database. You can do this for free on Heroku. Detailed instructions (stolen shamelessly from here):

  1. Navigate to https://www.heroku.com/, and create an account if you don’t already have one.
  2. On Heroku’s Dashboard, click “New” and choose “Create new app.”
  3. Give your app a name, and click “Create app.”
  4. On your app’s “Overview” page, click the “Configure Add-ons” button.
  5. In the “Add-ons” section of the page, type in and select “Heroku Postgres.”
  6. Choose the “Hobby Dev - Free” plan, which will give you access to a free PostgreSQL database that will support up to 10,000 rows of data. Click “Provision.”
  7. Now, click the “Heroku Postgres :: Database” link.
  8. You should now be on your database’s overview page. Click on 8 “Settings”, and then “View Credentials.” This is the information you’ll need to log into your database.

Finally, you need to create environment variables for all the secrets, which is described below.

Environment Variables

  1. PRIVATE_KEY: this is the private key you use to authenticate as an app with the GitHub API.
  2. WEBHOOK_SECRET: this is used to verify that payloads received by your app are actually from GitHub. This is described here.
  3. DATABASE_URL: this is the URL that contains the login information for your POSTGRESQL database, usually in the form: postgres://<username>:<password>@<url>:5432/<database_name>
  4. APP_ID: this is a unique identifier provided to you by GitHub when you register your app.
  5. FLASK_ENV: this is usually set to either production or development. You will want to use deployment for local testing.
  6. PORT: this is the port your app will be serving on. Note that if you are deploying to Heroku, Heroku will override this variable with their own value when building your app. For local development, you will want this to match the port Smee is serving to.
  7. APP_URL: this is the url for the homepage of your app that is provided to users as a link in issue comments. You can set this to an arbitrary value for local development.

Note: If you are using zsh, the dotenv plugin can be useful for managing environment variables.

Run Locally

  1. Install Dependencies: Install requirements.txt into a virtual environment. If you are using pipenv install the necessary dependencies from Pipfile.lock by typing pipenv install in the root of this repository.

  2. Run the flask app: run python flask_app/app.py from the root of this repository. For this to work, you must correctly set the environment variables as described in the Environment Variables section.

  3. Optional - Run app as docker container. A Docker container that serves Issue-Label Bot can be built with the command bash script/bootstrap from the root of this repository. This script builds a Docker image named hamelsmu/mlapp, which is also available on Dockerhub. If you desire to run the Docker container locally for testing, you must pass the necessary environment variables to the Docker container at runtime, as well as expose necessary ports for the app. See the References section for more resources on using Docker.

Deploy As A Service

The assets in this repo allow you to deploy to Heroku (easier) or a Kubernetes cluster (more advanced).

In Heroku, secrets can be passed in as configuration variables. Furthermore, this documentation describes how you can set secrets in Kubernetes. Make sure you set the environment variable FLASK_ENV to production if you are going to deploy the app publicly.

Contributing

We welcome all forms of contributions. We are especially interested in the following:

  • Bug fixes
  • Enhancements or additional features
  • Improvements to the model, or expansion of the dataset(s) used for training.

Roadmap

The authors of this project are interested in adding the following features in the near future:

  • Constructing better labels and negative samples of items that do not belong in the label set to drive further improvements.
  • Using the tools from fastai to explore:
    • State of the art architectures, such as Multi-Head Attention
    • Utilizing transfer learning to predict unique labels and/or enhance accuracy.
  • Using GitHub Actions to trigger automated deploys of this code.
  • Model pipeline orchestration on Argo pipelines.

References

Disclaimers

Issue-Label Bot is for educational and demonstration purposes only. Our goal was to provide a minimal working example for the community with the least amount of complexity as possible. Therefore, we believe the model demonstrated has great room from improvement. Furthermore, this app only works on public repositories and will do nothing if installed on a private repo.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].