-
Notifications
You must be signed in to change notification settings - Fork 0
All models put together in the UI. #12
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
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 integrates English-to-French translation into the existing speech‐to-text and sentiment analysis UI while updating documentation.
- Updated the translation test function to return the cleaned translated sentence.
- Modified the inference model file path in the speech‐to‐text module.
- Updated the Dash app to support translation output and adjusted module import paths.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/translation_french_english.py | Updated test_translation to return a string result with token cleanup. |
| src/modules/speech_to_text.py | Adjusted the model file path for the inference model loading. |
| app/voice_to_text_app.py | Added UI elements and callback changes to integrate translation output, and updated import paths. |
Comments suppressed due to low confidence (1)
app/voice_to_text_app.py:6
- The import path for SpeechToText was changed from 'src/modules/speech_to_text' to 'modules/speech_to_text'. Please ensure that this update matches the intended project folder structure so that the module is correctly resolved at runtime.
from modules.speech_to_text import SpeechToText
src/translation_french_english.py
Outdated
| def test_translation(transformer, preprocessor, input_sentence="Hello"): | ||
| """ |
Copilot
AI
Apr 21, 2025
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.
The test_translation function now returns a string (as indicated in the docstring) but lacks an explicit return type annotation. Consider adding '-> str' to the function signature for consistency.
| def test_translation(transformer, preprocessor, input_sentence="Hello"): | |
| """ | |
| def test_translation(transformer, preprocessor, input_sentence="Hello") -> str: |
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 integrates a new translation feature into the existing speech-to-text and sentiment analysis workflow. Key changes include updating the translation function to return a translated string, revising the model loading path for speech-to-text, and modifying the Dash UI and README documentation to incorporate the translation functionality.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/translation_french_english.py | Updated test_translation to return a string and remove token placeholders. |
| src/modules/speech_to_text.py | Revised the inference model path to reflect the new project structure. |
| app/voice_to_text_app.py | Integrated translation in the UI and updated related imports and callback outputs. |
| README.md | Updated documentation to include speech-to-text translation integration. |
Comments suppressed due to low confidence (3)
src/translation_french_english.py:124
- [nitpick] Consider renaming 'test_translation' to better reflect its role as a production translation function (e.g., 'perform_translation') to avoid confusion with typical test functions.
def test_translation(transformer, preprocessor, input_sentence="Hello") -> str:
src/modules/speech_to_text.py:115
- Ensure the updated relative path is correct for your deployment environment, as changing from './models/...' to 'src/models/...' may affect model loading when running from different working directories.
inference_model = tf.keras.models.load_model("src/models/inference_model.keras")
app/voice_to_text_app.py:6
- Verify that the updated import paths align with the project's directory structure so that all modules are resolved correctly at runtime.
from modules.speech_to_text import SpeechToText
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: