Skip to content

Basic RNN(LSTM) implementation for regular expression languages identification

Notifications You must be signed in to change notification settings

bar-katz/Basic_RNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic LSTM on regular expression languages

Create a regular expression language and run the LSTM.

This project is made in order to test LSTM capabilities.

Usage example

  1. Generate train and dev sets.
    gen_examples.py is an example on how to create a language.

    The script gen_examples.py will create regular expression samples for the language:
    [0-9]+a+[0-9]+b+[0-9]+c+[0-9]+d+[0-9]+

    Parameters:
    samples_file – the file which the samples will be writen to.
    num_samples – number of samples to generate.
    seq_max – maximum length of each contiguous sequence, for example a+ will be a sequence of random number of a
    in range [1, seq_max].

    example:
    python gen_examples.py data/train 1000 50
  2. Train the LSTM model on the language.
    Run basicLSTM.py on the data you created and check the results.

    Parameters:
    train_samples – train samples file.
    dev_samples – dev samples file.

    example:
    python basicLSTM.py data/train data/dev

Build With

  • PyTorch – the deep learning platform used

Author

Bar Katz – bar-katz on githubbarkatz138@gmail.com

Contributing

  1. Fork it (https://github.com/bar-katz/Basic_RNN/fork)
  2. Create your feature branch (git checkout -b feature)
  3. Commit your changes (git commit -am 'add feature')
  4. Push to the branch (git push origin feature)
  5. Create a new Pull Request

    Share your results!
    Found a language LSTM can not learn try to understand why and add your language description to languages directory.

About

Basic RNN(LSTM) implementation for regular expression languages identification

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages