All Projects → paarthneekhara → Bytenet Tensorflow

paarthneekhara / Bytenet Tensorflow

Licence: mit
ByteNet for character-level language modelling

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Bytenet Tensorflow

Deep Learning Drizzle
Drench yourself in Deep Learning, Reinforcement Learning, Machine Learning, Computer Vision, and NLP by learning from these exciting lectures!!
Stars: ✭ 9,717 (+2946.08%)
Mutual labels:  natural-language-processing, deep-neural-networks, machine-translation
Mtbook
《机器翻译:基础与模型》肖桐 朱靖波 著 - Machine Translation: Foundations and Models
Stars: ✭ 2,307 (+623.2%)
Mutual labels:  natural-language-processing, machine-translation
Multihead Siamese Nets
Implementation of Siamese Neural Networks built upon multihead attention mechanism for text semantic similarity task.
Stars: ✭ 144 (-54.86%)
Mutual labels:  natural-language-processing, deep-neural-networks
Zhihu
This repo contains the source code in my personal column (https://zhuanlan.zhihu.com/zhaoyeyu), implemented using Python 3.6. Including Natural Language Processing and Computer Vision projects, such as text generation, machine translation, deep convolution GAN and other actual combat code.
Stars: ✭ 3,307 (+936.68%)
Mutual labels:  natural-language-processing, machine-translation
100 Days Of Nlp
Stars: ✭ 125 (-60.82%)
Mutual labels:  natural-language-processing, deep-neural-networks
Awesome Ai Services
An overview of the AI-as-a-service landscape
Stars: ✭ 133 (-58.31%)
Mutual labels:  natural-language-processing, machine-translation
Deep Math Machine Learning.ai
A blog which talks about machine learning, deep learning algorithms and the Math. and Machine learning algorithms written from scratch.
Stars: ✭ 173 (-45.77%)
Mutual labels:  natural-language-processing, deep-neural-networks
Pytorchnlpbook
Code and data accompanying Natural Language Processing with PyTorch published by O'Reilly Media https://nlproc.info
Stars: ✭ 1,390 (+335.74%)
Mutual labels:  natural-language-processing, deep-neural-networks
Deep Survey Text Classification
The project surveys 16+ Natural Language Processing (NLP) research papers that propose novel Deep Neural Network Models for Text Classification, based on Convolutional Neural Networks (CNN) and Recurrent Neural Networks (RNN). It also implements each of the models using Tensorflow and Keras.
Stars: ✭ 187 (-41.38%)
Mutual labels:  natural-language-processing, deep-neural-networks
Germanwordembeddings
Toolkit to obtain and preprocess german corpora, train models using word2vec (gensim) and evaluate them with generated testsets
Stars: ✭ 189 (-40.75%)
Mutual labels:  natural-language-processing, deep-neural-networks
Attention Mechanisms
Implementations for a family of attention mechanisms, suitable for all kinds of natural language processing tasks and compatible with TensorFlow 2.0 and Keras.
Stars: ✭ 203 (-36.36%)
Mutual labels:  natural-language-processing, machine-translation
Nlp Pretrained Model
A collection of Natural language processing pre-trained models.
Stars: ✭ 122 (-61.76%)
Mutual labels:  natural-language-processing, deep-neural-networks
Nonautoreggenprogress
Tracking the progress in non-autoregressive generation (translation, transcription, etc.)
Stars: ✭ 118 (-63.01%)
Mutual labels:  natural-language-processing, machine-translation
Tokenizer
Fast and customizable text tokenization library with BPE and SentencePiece support
Stars: ✭ 132 (-58.62%)
Mutual labels:  natural-language-processing, machine-translation
Opus Mt
Open neural machine translation models and web services
Stars: ✭ 111 (-65.2%)
Mutual labels:  natural-language-processing, machine-translation
Spark Nlp
State of the Art Natural Language Processing
Stars: ✭ 2,518 (+689.34%)
Mutual labels:  natural-language-processing, machine-translation
Bert As Service
Mapping a variable-length sentence to a fixed-length vector using BERT model
Stars: ✭ 9,779 (+2965.52%)
Mutual labels:  natural-language-processing, deep-neural-networks
Hardware Aware Transformers
[ACL 2020] HAT: Hardware-Aware Transformers for Efficient Natural Language Processing
Stars: ✭ 206 (-35.42%)
Mutual labels:  natural-language-processing, machine-translation
Texar
Toolkit for Machine Learning, Natural Language Processing, and Text Generation, in TensorFlow. This is part of the CASL project: http://casl-project.ai/
Stars: ✭ 2,236 (+600.94%)
Mutual labels:  natural-language-processing, machine-translation
Character Based Cnn
Implementation of character based convolutional neural network
Stars: ✭ 205 (-35.74%)
Mutual labels:  natural-language-processing, deep-neural-networks

byteNet-tensorflow

Join the chat at https://gitter.im/byteNet-tensorflow/Lobby

This is a tensorflow implementation of the byte-net model from DeepMind's paper Neural Machine Translation in Linear Time.

From the abstract

The ByteNet decoder attains state-of-the-art performance on character-level language modeling and outperforms the previous best results obtained with recurrent neural networks. The ByteNet also achieves a performance on raw character-level machine translation that approaches that of the best neural translation models that run in quadratic time. The implicit structure learnt by the ByteNet mirrors the expected alignments between the sequences.

ByteNet Encoder-Decoder Model:

Model architecture

Image Source - Neural Machine Translation in Linear Time paper

The model applies dilated 1d convolutions on the sequential data, layer by layer to obain the source encoding. The decoder then applies masked 1d convolutions on the target sequence (conditioned by the encoder output) to obtain the next character in the target sequence.The character generation model is just the byteNet decoder, while the machine translation model is the combined encoder and decoder.

Implementation Notes

  1. The character generation model is defined in ByteNet/generator.py and the translation model is defined in ByteNet/translator.py. ByteNet/ops.py contains the bytenet residual block, dilated conv1d and layer normalization.
  2. The model can be configured by editing model_config.py.
  3. Number of residual channels 512 (Configurable in model_config.py).

Requirements

  • Python 2.7.6
  • Tensorflow 1.2.0

Datasets

  • The character generation model has been trained on Shakespeare text. I have included the text file in the repository Data/generator_training_data/shakespeare.txt.
  • The machine translation model has been trained for german to english translation. You may download the news commentary dataset from here http://www.statmt.org/wmt16/translation-task.html

Training

Create the following directories Data/tb_summaries/translator_model, Data/tb_summaries/generator_model, Data/Models/generation_model, Data/Models/translation_model.

  • Text Generation

    • Configure the model by editing model_config.py.
    • Save the text files to train on, in Data/generator_training_data. A sample shakespeare.txt is included in the repo.
    • Train the model by : python train_generator.py --text_dir="Data/generator_training_data"
    • python train_generator.py --help for more options.
  • Machine Translation

    • Configure the model by editing model_config.py.
    • Save the source and target sentences in separate files in Data/MachineTranslation. You may download the new commentary training corpus using this link.
    • The model is trained on buckets of sentence pairs of length in mutpiples of a configurable parameter bucket_quant. The sentences are padded with a special character beyond the actual length.
    • Train translation model using:
      • python train_translator.py --source_file=<source sentences file> --target_file=<target sentences file> --bucket_quant=50
      • python train_translator.py --help for more options.

Generating Samples

  • Generate new samples using :
    • python generate.py --seed="SOME_TEXT_TO_START_WITH" --sample_size=<SIZE OF GENERATED SEQUENCE>
  • You can test sample translations from the dataset using python translate.py.
    • This will pick random source sentences from the dataset and translate them.

Sample Generations

ANTONIO:
What say you to this part of this to thee?

KING PHILIP:
What say these faith, madam?

First Citizen:
The king of England, the will of the state,
That thou dost speak to me, and the thing that shall
In this the son of this devil to the storm,
That thou dost speak to thee to the world,
That thou dost see the bear that was the foot,

Translation Results to be updated

TODO

  • Evaluating the translation Model
  • Implement beam search - Contributors welcomed. Currently the model samples from the probability distribution from the top k most probable predictions.

References

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