GithubHelp home page GithubHelp logo

maikelgonzalez / ai-copywriter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ematvey/ai-copywriter

1.0 2.0 0.0 53 KB

Research: poor English -> good English translation

License: MIT License

Python 100.00%

ai-copywriter's Introduction

AI copywriter

Given a large corpus of correct English texts and a one-way mechanism to corrupt a sentence in such a way that will be similar to mistakes that non-native speaker makes, we can develop seq2seq model that acts like denoising autoencoder. It could be used by non-proficient English writers to write better texts.

Main hypothesis is that corruption does not have to be very clever, just sufficiently diverse. Currently I use a set of simple heuristics for corruption, but later hope to develop a generative model for that.

Status

Trying to make it work. LSTMs seem to be less volatile then GRUs. Deeper nets (5 layers vs 3 layers) seem to converge to higher loss.

Probably unnecessary warning: this is research project, not in any way suitable for production use. No API stability guarantee of any kind is given. If you want to derive from this work, copy-paste it!

How to run

Requires Python >=3.5 and TensorFlow r1.0.0.

Download Wikipedia dump e.g. with

wget -c https://dumps.wikimedia.org/enwiki/latest/enwiki-latest-pages-articles.xml.bz2

Install deps.

Run preprocessor:

python3 wiki_prepare.py path/to/wikidump

It should take several hours. Corruption types that preprocessor is doing could be found in wiki_data_op.py.

Run training:

python3 worker.py --device=/gpu:0 --batch-size=30

You may want to increase/decrease batch size based on your GPU mem. I have GTX 970 with 4gb.

Related work

@atpaino implemented similar model on smaller corpus in Jan 2017. His work is based on tensorflow's translate example, which uses static RNN rollout with bucketizing. In this work I attempt to implement dynamic RNN rollout using tensorflow's lower-level blocks.

License

MIT

ai-copywriter's People

Contributors

ematvey avatar

Stargazers

Roman avatar

Watchers

Maikel avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.