Skip to content

Repository files navigation

*Introduction*
This report evaluates three different neural machine translation models for translating between English and French languages. Each model employs a distinct architecture and training approach, aiming to achieve accurate and fluent translations. The evaluation includes both quantitative analysis of training metrics and qualitative assessment of translation quality.

Problem 1: English to French Neural Machine Translation

Model Overview:
The first model implements a basic sequence-to-sequence neural machine translation architecture using TensorFlow/Keras. It consists of an embedding layer, a GRU layer, and a TimeDistributed Dense layer. The model is trained on a dataset of English-French sentence pairs using the Adam optimizer and sparse categorical cross-entropy loss.

Training Process:
The model is trained for 10 epochs with a 20% validation split. The training loss decreases gradually over epochs, indicating learning progress. However, the increase in validation loss suggests potential overfitting or difficulty in generalization.

Qualitative Evaluation:
Qualitative evaluation on a sample English sentence ("I am cold") demonstrates the model's capability to generate reasonable translations for simple sentences. Further evaluation on a diverse range of sentences is recommended to assess translation quality comprehensively.

Discussion:
While the model shows promise for simple sentences, improvements are needed for more complex or domain-specific language. Further evaluation on a larger and more diverse dataset, along with techniques like attention mechanisms, could enhance translation quality.

Problem 2: English to French Neural Machine Translation with Attention

Model Overview:
The second model extends the basic sequence-to-sequence architecture by incorporating an attention mechanism. This attention-based model aims to improve translation quality by focusing on relevant parts of the input sentence during translation.

Training Process:
The model is trained on the entire dataset for 10 epochs using the Adam optimizer and sparse categorical cross-entropy loss. Both training and validation losses decrease gradually over epochs, indicating learning progress and improved generalization.

Qualitative Evaluation:
Qualitative evaluation involves generating French translations for sample English sentences and assessing translation quality. The attention mechanism helps improve translation accuracy and capture long-range dependencies in input sentences.

Comparison with Problem 1:
Comparing with the basic sequence-to-sequence model from Problem 1, the attention-based model demonstrates improved translation quality and training stability. The attention mechanism allows the model to focus on relevant parts of the input, resulting in more accurate translations.

Problem 3: French to English Neural Machine Translation

Model Overview:
The third model translates French sentences into English using an encoder-decoder architecture with GRU cells. The model is trained on a dataset of French-English sentence pairs, aiming to achieve accurate and fluent translations.

Training Process:
The model is trained for 10,000 iterations using stochastic gradient descent (SGD) with a negative log-likelihood loss function. Training loss and validation loss are monitored to assess the model's convergence and generalization ability.

Qualitative Evaluation:
Qualitative evaluation involves generating English translations for sample French sentences and comparing them with ground truth translations. The model's translation quality and linguistic accuracy are assessed based on the qualitative evaluation.

Comparison between French-to-English and English-to-French Models:
Comparing the French-to-English model with the English-to-French models, insights are gained into the relative performance and effectiveness of translation directions. Factors such as training loss, validation loss, validation accuracy, and translation quality are considered in the comparison.

Conclusion:
In conclusion, the evaluation of neural machine translation models for English-French and French-English translation involves both quantitative analysis of training metrics and qualitative assessment of translation quality. Each model presents unique strengths and areas for improvement, highlighting the importance of continued research and development in the field of neural machine translation.

About

Andyqballer/RealTime-MachineLearning-Homework4

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages