YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Build Your Own Simple Translator and Seq-to-Seq Translator
This project provides a guide to building two types of neural machine translation (NMT) models using sequence-to-sequence (Seq-to-Seq) learning. It covers both a foundational simple translator model and a more advanced Seq-to-Seq model with an attention mechanism, ideal for translating text between languages. This repository contains the code and resources for building two types of neural machine translation models using sequence-to-sequence (Seq-to-Seq) learning.
Project Overview This project walks through the steps to create two different machine translation models: Simple Translator: A basic model that demonstrates the core principles of machine translation, using a straightforward encoder-decoder structure. Seq-to-Seq Translator with Attention: An advanced translation model utilizing the attention mechanism to improve translation accuracy by dynamically focusing on relevant parts of the input sequence.
Dataset Preparation
Dataset: Use a parallel text dataset, such as the English-Finnish data. For English https://huggingface.co/datasets/yahma/alpaca-cleaned and for Finnish https://huggingface.co/datasets/saillab/taco-datasets/tree/main/multilingual-instruction-tuning-dataset%20/multilingual-alpaca-52k-gpt-4/Finnish was used Preprocess the Data:
- Tokenize and clean text data.
- Prepare pairs in a tab-separated format, where each line contains a source and target sentence pair.
How to Use
- Clone the repository:
git clone <repository_url> cd <repository_directory> Install the required packages: Ensure you have the necessary libraries installed. Can be done by running:
pip install -r requirements.txt Run the Jupyter Notebook: Open the notebook in Jupyter:
jupyter notebook LSTM_based_translator.ipynb and Seq2Seq_based_translator.ipynb