-
Notifications
You must be signed in to change notification settings - Fork 0
Improving code. #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving code. #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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(
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: