All Projects → vpj → Python_autocomplete

vpj / Python_autocomplete

Licence: mit
A simple neural network for python autocompletion

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python autocomplete

Bit
Bit is a modern Git CLI
Stars: ✭ 5,723 (+634.66%)
Mutual labels:  autocomplete
Insignia
🔖 Customizable tag input. Progressive. No non-sense!
Stars: ✭ 665 (-14.63%)
Mutual labels:  autocomplete
Getting Things Done With Pytorch
Jupyter Notebook tutorials on solving real-world problems with Machine Learning & Deep Learning using PyTorch. Topics: Face detection with Detectron 2, Time Series anomaly detection with LSTM Autoencoders, Object Detection with YOLO v5, Build your first Neural Network, Time Series forecasting for Coronavirus daily cases, Sentiment Analysis with BERT.
Stars: ✭ 738 (-5.26%)
Mutual labels:  lstm
Zsh Autocomplete
🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
Stars: ✭ 641 (-17.72%)
Mutual labels:  autocomplete
React Autosuggest
WAI-ARIA compliant React autosuggest component
Stars: ✭ 5,773 (+641.08%)
Mutual labels:  autocomplete
Text Classification
Implementation of papers for text classification task on DBpedia
Stars: ✭ 682 (-12.45%)
Mutual labels:  lstm
Vad
Voice activity detection (VAD) toolkit including DNN, bDNN, LSTM and ACAM based VAD. We also provide our directly recorded dataset.
Stars: ✭ 622 (-20.15%)
Mutual labels:  lstm
Tabnine Vscode
Visual Studio Code client for TabNine. https://marketplace.visualstudio.com/items?itemName=TabNine.tabnine-vscode
Stars: ✭ 770 (-1.16%)
Mutual labels:  autocomplete
Cmake Ide
Use Emacs as a C/C++ IDE
Stars: ✭ 661 (-15.15%)
Mutual labels:  autocomplete
Lstm Char Cnn Tensorflow
in progress
Stars: ✭ 737 (-5.39%)
Mutual labels:  lstm
Elasticsuite
Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
Stars: ✭ 647 (-16.94%)
Mutual labels:  autocomplete
Autocompletefield
Subclass of UITextField that shows inline suggestions while typing.
Stars: ✭ 656 (-15.79%)
Mutual labels:  autocomplete
Stockpriceprediction
Stock Price Prediction using Machine Learning Techniques
Stars: ✭ 700 (-10.14%)
Mutual labels:  lstm
Conv Emotion
This repo contains implementation of different architectures for emotion recognition in conversations.
Stars: ✭ 646 (-17.07%)
Mutual labels:  lstm
Use Places Autocomplete
😎 📍 React hook for Google Maps Places Autocomplete.
Stars: ✭ 739 (-5.13%)
Mutual labels:  autocomplete
Ad examples
A collection of anomaly detection methods (iid/point-based, graph and time series) including active learning for anomaly detection/discovery, bayesian rule-mining, description for diversity/explanation/interpretability. Analysis of incorporating label feedback with ensemble and tree-based detectors. Includes adversarial attacks with Graph Convolutional Network.
Stars: ✭ 641 (-17.72%)
Mutual labels:  lstm
Selectpage
A simple style and powerful selector, including ajax remote data, autocomplete, pagination, tags, i18n and keyboard navigation features
Stars: ✭ 679 (-12.84%)
Mutual labels:  autocomplete
Seq2seq Chatbot
Chatbot in 200 lines of code using TensorLayer
Stars: ✭ 777 (-0.26%)
Mutual labels:  lstm
Vue Tags Input
A tags input component for VueJS
Stars: ✭ 761 (-2.31%)
Mutual labels:  autocomplete
Minisearch
Tiny and powerful JavaScript full-text search engine for browser and Node
Stars: ✭ 737 (-5.39%)
Mutual labels:  autocomplete

⭐️ We rewrote a simpler version of this at lab-ml/source_code_modelling and we intend to maintain it for a while

This a toy project we started to see how well a simple LSTM model can autocomplete python code.

It gives quite decent results by saving above 30% key strokes in most files, and close to 50% in some. We calculated key strokes saved by making a single (best) prediction and selecting it with a single key.

We do a beam search to find predictions, upto ~10 characters ahead. So far it's too inefficient, if you are wondering about editor integration.

We train and predict on after cleaning comments, strings and blank lines in python code. The model is trained after tokenizing python code. It seems more efficient than character level prediction with byte-pair encoding.

A saved model is included in this repo. It is trained on tensorflow/models.

Here's a sample evaluation on a source file from validation set. Red characters are when a auto-completion started; i.e. user presses TAB to select the completion. The green character and and the following characters highlighted in gray are auto-completed. As you can see, it starts and ends completions arbitrarily. That is a suggestion could be 'tensorfl' and not the complete identifier 'tensorflow' which can be a little annoying in a real usage scenario. We can limit them to finish on end of tokens to fix that. Also you can notice that it completes across operators as well. Increasing the length of the beam search will let it complete longer pieces of code.

Try it yourself

  1. Clone this repo

  2. Install requirements from requirements.txt

  3. Copy data to ./data/source

  4. Run extract_code.py to collect all python files, encode and merge them into all.py

  5. Run evaluate.py to evaluate the model. I have included a checkpoint in the repo.

  6. Run train.py to train the model

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].