• Stars
    star
    1,149
  • Rank 39,160 (Top 0.8 %)
  • Language
    Python
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A neural network trained to help writing neural network code using autocomplete

Neural Complete

Neural Complete is autocomplete based on a generative LSTM neural network, trained not only by python code but also on python source code.

Ironically, it is trained on files containing keras imports. The result is a neural network trained to help writing neural network code.

Rather than completing a word, it will suggest finishing a whole line. It uses information from previous lines to make a suggestion.

One could imagine that everyone will have a neural network to automagically complete their personal scripts based on their own neural model :-)

But not yet with this code.

You're encouraged to train on your own data, which should be made easier by using Neural Complete.

Demo

Neural Complete demo

The first time model is written, it suggests to create it as a variable (model = Sequential()).

The second time model is written, it suggests using it instead (model.add(...)). It shows that it is able to use the context!

The final line does contain mistakes, but should get more precise with more data and also more context.

Models

There are 2 models included, a character based model and a python token model. The benefit of the char based model is that it can complete at any moment, while the token based model only works with completed tokens (it cannot finish a word). However, the token based model is based on a higher level unit (semantic), and should make more sense most of the time.

The char based model looks back up to 80 characters, while the token based model looks back up to 20 tokens.

It would be very fun to experiment with a future model in which it will use the python AST and take out variable naming out of the equation.

Do It Yourself

Scraping data

Unfortunately the Github API does not allow to search by filename, so I wrote a scraping script to gather python data specifically trained on keras source code. You can change the search query to gather your own data. Do not overdo it as to "annoy" github. You would need a lot more for a reasonable result!

The models have only been trained on 26 scripts.

Backend

Train a model using keras, serve it with flask.

See backend

Frontend

The frontend is a very thin layer communicating with the backend to receive autocomplete suggestions, written in Angular 2. The dist folder has been included so you can easily run it yourself without dependencies.

See frontend

Credits

It uses a lot of the ideas of the standard keras LSTM text generation example.

Whenever using any of this code: please attribute whenever you can.

More Repositories

1

whereami

Uses WiFi signals πŸ“Ά and machine learning to predict where you are
Python
5,081
star
2

yagmail

Send email in Python conveniently for gmail using yagmail
Python
2,579
star
3

gittyleaks

πŸ’§ Find sensitive information for a git repo
Python
687
star
4

sky

πŸŒ… next generation web crawling using machine intelligence
Python
321
star
5

contractions

Fixes contractions such as `you're` to `you are`
Python
301
star
6

access_points

Scan your WiFi and get access point information and signal quality
Python
181
star
7

textsearch

Find strings/words in text; convenience and C speed πŸŽ†
Python
121
star
8

brightml

Convenient Machine-Learned Auto Brightness (Linux)
Python
119
star
9

shrynk

Using Machine Learning to learn how to Compress ⚑
Python
109
star
10

loco

Share localhost through SSH. Local/Remote port forwarding made safe and easy.
Python
105
star
11

cliche

Build a simple command-line interface from your functions πŸ’»
Python
105
star
12

tok

Fast and customizable tokenization 🚀
Python
65
star
13

aserve

Easily mock an API β˜•
Python
50
star
14

just

Just is a wrapper to automagically read/write a file based on extension
Python
48
star
15

xtoy

Automated Machine Learning: go from 'X' to 'y' without effort.
Python
47
star
16

spacy_api

Server/Client around Spacy to load spacy only once
Python
46
star
17

requests_viewer

View requests objects with style
Python
42
star
18

cant

For those who can't remember how to get a result
Python
33
star
19

aioyagmail

makes sending emails very easy by doing all the magic for you, asynchronously
Python
29
star
20

sysdm

Scripts as a service. Builds on systemd (for Linux)
Python
21
star
21

deep_eye2mouse

Move the mouse by your webcam + eyes
Python
20
star
22

reddit_ml_challenge

Reddit Machine Learning: Tagging Challenge
Python
19
star
23

inthenews.io

Get the latest and greatest in news (on Python)
CSS
19
star
24

crtime

Get creation time of files for any platform - no external dependencies ⏰
Python
16
star
25

natura

Find currencies / money talk in natural text
Python
15
star
26

rebrand

✨ Refactor your software using programming language independent, case-preserving string replacement πŸ’„
Python
15
star
27

emacs-kooten-theme

Dark color theme by kootenpv
Emacs Lisp
14
star
28

justdb

Just a thread/process-safe, file-based, fast, database.
Python
8
star
29

fastlang

Fast Detection of Language without Dependencies
Python
7
star
30

quickpip

A template for creating a quick, maintainable and high quality pypi project
Python
7
star
31

xdb

Ambition: Single API for any database in Python
Python
6
star
32

nostalgia_chrome

Self tracking your online life!
Python
5
star
33

cnn_basics

NLP using CNN on Cornell Movie Ratings
Python
4
star
34

kootenpv.github.io

Pascal van Kooten's website hosted on github.io
CSS
3
star
35

gittraffic

Save your gittrafic data so it won't get lost!
Python
3
star
36

flymake-solidity

flymake for solidity, using flymake-easy: live feedback on writing solidity contracts
Emacs Lisp
3
star
37

ppm

Safe password manager
C
2
star
38

automl_presentation

Example code for the presentation "Automated Machine Learning"
Python
2
star
39

dot_access

Makes nested python objects easy to go through
Python
1
star
40

feedview

View a feed url with `feedview <URL>`
Python
1
star
41

PassMan

android app for ppm
C
1
star
42

mockle

Automatic Mocking by Pickles
Python
1
star
43

emoji-picker

Python
1
star
44

elpy

Emacs Python Development Environment
Emacs Lisp
1
star