Skip to content

Conversation

@jvachier
Copy link
Owner

@jvachier jvachier commented Apr 21, 2025

Describe your changes

Provide a clear and concise description of the changes made in this pull request. Include any relevant context or background information.

  • What is the purpose of this pull request?
  • What problem does it solve?
  • What functionality does it add or improve?

Issue ticket number and link

Type of Change

Check the type of change your pull request introduces:

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (code improvements without changing functionality)

Checklist before requesting a review

Before submitting your pull request, ensure the following:

  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added or updated relevant documentation (if applicable).
  • My changes do not introduce any new warnings or errors.
  • I have checked for security vulnerabilities in the code.
  • I have ensured backward compatibility (if applicable).

@jvachier jvachier self-assigned this Apr 21, 2025
@jvachier jvachier requested a review from Copilot April 21, 2025 06:37
Copy link

Copilot AI left a 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(

@jvachier jvachier requested a review from Copilot April 21, 2025 07:29
Copy link

Copilot AI left a 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(

@jvachier jvachier merged commit 3e51060 into main Apr 21, 2025
1 check passed
@jvachier jvachier deleted the jv/translation_in_app branch April 21, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants