This project implements a Neural Machine Translation (NMT) system for translating English to Portuguese using Long Short-Term Memory (LSTM) networks with attention mechanisms.
Machine translation is a fundamental task in natural language processing (NLP) that aims to automatically translate text from one language to another. This project focuses on translating English sentences into Portuguese using advanced deep learning techniques.
- Encoder-Decoder Architecture: Utilizes a sequence-to-sequence model with an encoder-decoder architecture.
- Attention Mechanism: Incorporates attention mechanisms to improve translation accuracy, allowing the model to focus on relevant parts of the input sentence during translation.
- TensorFlow Implementation: Built entirely using TensorFlow, a popular deep learning framework.
- Greedy and Minimum Bayes Risk (MBR) Decoding: Provides two methods for generating translations: greedy decoding for simplicity and MBR decoding for potentially better quality translations.
The encoder processes the input English sentence into a fixed-dimensional context vector, capturing its semantic meaning using an embedding layer and a bidirectional LSTM.
The decoder takes the context vector from the encoder and generates the translated Portuguese sentence. It uses attention mechanisms to focus on different parts of the input sentence dynamically while generating each word.
A specialized layer within the decoder that calculates attention between the context vector from the encoder and the target sentence being generated by the decoder.
To use this project, ensure you have the following dependencies installed:
- Python 3.x
- TensorFlow
- NumPy