Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces several improvements including logging integration, refactoring of BLEU score evaluation, and minor code cleanups.
- Added logging configuration and informational messages during key operations.
- Moved the BLEU evaluation logic from the translation script into the transformer components module for better modularity.
- Minor reorganization of model-building and training workflow.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/translation_french_english.py | Added logging, refactored BLEU evaluation to use external function. |
| src/modules/transformer_components.py | Added new BLEU evaluation function with logging support. |
Comments suppressed due to low confidence (1)
src/translation_french_english.py:102
- The variable 'transformer' is used for model training but its instantiation is not shown in the diff. Please ensure that 'transformer' is properly defined before it is used.
with tf.device("/GPU:0"):
transformer.fit(
There was a problem hiding this comment.
Pull Request Overview
This PR improves the codebase by refactoring model imports for sentiment analysis and transformer models while adding logging and enhanced evaluation for translation. Key updates include:
- Updating import paths to use new modules for sentiment analysis and model building.
- Refactoring the Transformer model construction and integrating logging and BLEU evaluation.
- Adding a new TRANSFORMER_MODEL path and enhancing custom Keras layers with get_config methods.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_model.py | Updated import to use modules.model_sentiment_analysis for consistency. |
| src/translation_french_english.py | Refactored Transformer model construction and training flow with added logging and BLEU evaluation. |
| src/sentiment_analysis.py | Updated text vectorizer import for improved sentiment analysis support. |
| src/modules/utils.py | Added a new entry for TRANSFORMER_MODEL to support model loading. |
| src/modules/transformer_components.py | Improved serialization with get_config methods and centralized BLEU evaluation. |
| src/modules/sentiment_analysis_utils.py | Updated model import for sentiment analysis to reference the correct module. |
Comments suppressed due to low confidence (1)
src/translation_french_english.py:113
- The variable 'transformer' is referenced for training but is never defined in the transformer_model function. Please assign the constructed model to 'transformer' before calling its fit() method.
transformer.fit(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Provide a clear and concise description of the changes made in this pull request. Include any relevant context or background information.
Issue ticket number and link
Type of Change
Check the type of change your pull request introduces:
Checklist before requesting a review
Before submitting your pull request, ensure the following: