Skip to content
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

add sweden and norway #179

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open

add sweden and norway #179

wants to merge 6 commits into from

Conversation

andlo
Copy link
Contributor

@andlo andlo commented Nov 4, 2024

Summary by CodeRabbit

  • New Features

    • Added support for Norwegian language codes.
    • Introduced new configuration files for Danish, Norwegian, and Swedish locales, enhancing measurement units and date/time formats.
    • Implemented new TTS and STT settings for various languages, improving voice output and speech recognition capabilities.
  • Chores

    • Added multiple configuration files to streamline language and speech functionalities.

Copy link
Contributor

coderabbitai bot commented Nov 4, 2024

Walkthrough

The changes in this pull request include the addition of a new language mapping entry for Norwegian in the get_full_lang_code function, mapping 'no' to 'no-no'. Additionally, several new configuration files have been introduced for Danish, Norwegian, and Swedish settings in various directories, specifying parameters for measurement units, date/time formats, and text-to-speech (TTS) functionalities. These configurations enhance the system's support for these languages and their respective settings without altering existing functionality.

Changes

Files Change Summary
ovos_config/locale.py Added Norwegian language mapping: 'no': 'no-no' in get_full_lang_code function.
ovos_config/recommends/base/da-dk.conf New configuration file for Danish measurement units and date/time formats.
ovos_config/recommends/base/no-no.conf New configuration file for Norwegian measurement units and date/time formats.
ovos_config/recommends/base/sv-se.conf New configuration file for Swedish measurement units and date/time formats.
ovos_config/recommends/offline_male/da-dk.conf New TTS configuration file for Danish using ovos-tts-plugin-piper.
ovos_config/recommends/offline_male/no-no.conf New TTS configuration file for Norwegian using ovos-tts-plugin-piper.
ovos_config/recommends/offline_stt/da-dk.conf New STT configuration file for Danish using ovos-stt-plugin-fasterwhisper.
ovos_config/recommends/offline_stt/no-no.conf New STT configuration file for Norwegian using ovos-stt-plugin-fasterwhisper.
ovos_config/recommends/offline_stt/sv-se.conf New STT configuration file for Swedish using ovos-stt-plugin-fasterwhisper.
ovos_config/recommends/online_male/da-dk.conf New TTS configuration file for Danish using ovos-tts-plugin-server.
ovos_config/recommends/online_male/no-no.conf New TTS configuration file for Norwegian using ovos-tts-plugin-server.
ovos_config/recommends/online_male/sv-se.conf New TTS configuration file for Swedish using ovos-tts-plugin-server.
ovos_config/recommends/online_stt/da-dk.conf New STT configuration file for Danish using ovos-stt-plugin-server.
ovos_config/recommends/online_stt/no-no.conf New STT configuration file for Norwegian using ovos-stt-plugin-server.

Possibly related PRs

  • feat:autoconfigure language #158: Involves the automatic configuration of language settings, including the addition of language codes, directly related to the enhancement of language code retrieval for Norwegian.
  • Danish added #178: Introduces a new configuration for Danish language settings, relevant to the addition of language support similar to the Norwegian mapping.

Suggested labels

feature

Poem

🐇 In the land of code, where rabbits play,
New languages bloom, brightening the day.
Norwegian whispers, Danish delight,
TTS and STT, all set to take flight!
With each new config, we hop with glee,
A world of words, as sweet as can be! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (dev@593f36b). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             dev    #179   +/-   ##
=====================================
  Coverage       ?   0.00%           
=====================================
  Files          ?      10           
  Lines          ?     877           
  Branches       ?       0           
=====================================
  Hits           ?       0           
  Misses         ?     877           
  Partials       ?       0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (6)
ovos_config/recommends/online_stt/da-dk.conf (1)

4-4: Consider configuring a fallback STT module.

The empty fallback module configuration might lead to degraded user experience if the primary STT module fails. Consider setting up a fallback module to ensure continuous operation.

Example configuration with a fallback:

   "stt": {
     "module": "ovos-stt-plugin-server",
-    "fallback_module": ""
+    "fallback_module": "ovos-stt-plugin-vosk"
   }
ovos_config/recommends/offline_male/da-dk.conf (1)

1-8: Note: PR title doesn't reflect Danish configuration.

The PR title mentions adding Sweden and Norway, but this file adds Danish (da-dk) configuration. Consider updating the PR title to accurately reflect all language additions.

ovos_config/recommends/offline_stt/da-dk.conf (1)

1-9: Consider using a larger model and adding a fallback module for better reliability.

While the configuration is well-structured, consider the following suggestions:

  1. The "small" model might not provide optimal accuracy for Danish speech recognition. Consider using "medium" or "large" if memory constraints allow.
  2. Having no fallback module ("fallback_module": "") could impact reliability if the primary module fails.

Consider updating the configuration:

 {
   "stt": {
     "module": "ovos-stt-plugin-fasterwhisper",
-    "fallback_module": "",
+    "fallback_module": "ovos-stt-plugin-vosk",
     "ovos-stt-plugin-fasterwhisper": {
-        "model": "small"
+        "model": "medium"
     }
   }
 }
ovos_config/recommends/offline_stt/no-no.conf (2)

3-4: Consider adding a fallback STT module for improved reliability.

While the primary STT module is correctly specified, having no fallback module ("fallback_module": "") might impact service reliability if the primary module fails.

Consider adding a fallback module:

  "stt": {
    "module": "ovos-stt-plugin-fasterwhisper",
-   "fallback_module": "",
+   "fallback_module": "ovos-stt-plugin-vosk",

5-7: Consider specifying language code and reviewing model size for Norwegian.

Two suggestions to enhance the FasterWhisper configuration:

  1. Add explicit language code to improve recognition accuracy
  2. Consider using a larger model for better accuracy with Norwegian language

Consider updating the configuration:

  "ovos-stt-plugin-fasterwhisper": {
-     "model": "small"
+     "model": "medium",
+     "language": "no"
  }

The "medium" model provides a better balance between accuracy and resource usage, especially important for languages like Norwegian that might not be as well-represented in the training data as English.

ovos_config/recommends/offline_stt/sv-se.conf (1)

4-4: Consider adding a fallback STT module.

Having no fallback module ("fallback_module": "") could impact system reliability if the primary module fails. Consider adding a fallback module to ensure continuous operation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fab4527 and 2a42ade.

📒 Files selected for processing (15)
  • ovos_config/locale.py (1 hunks)
  • ovos_config/recommends/base/da-dk.conf (1 hunks)
  • ovos_config/recommends/base/no-no.conf (1 hunks)
  • ovos_config/recommends/base/sv-se.conf (1 hunks)
  • ovos_config/recommends/offline_male/da-dk.conf (1 hunks)
  • ovos_config/recommends/offline_male/no-no.conf (1 hunks)
  • ovos_config/recommends/offline_male/se-sv.conf (1 hunks)
  • ovos_config/recommends/offline_stt/da-dk.conf (1 hunks)
  • ovos_config/recommends/offline_stt/no-no.conf (1 hunks)
  • ovos_config/recommends/offline_stt/sv-se.conf (1 hunks)
  • ovos_config/recommends/online_male/da-dk.conf (1 hunks)
  • ovos_config/recommends/online_male/no-no.conf (1 hunks)
  • ovos_config/recommends/online_male/sv-se.conf (1 hunks)
  • ovos_config/recommends/online_stt/da-dk.conf (1 hunks)
  • ovos_config/recommends/online_stt/no-no.conf (1 hunks)
✅ Files skipped from review due to trivial changes (8)
  • ovos_config/recommends/base/da-dk.conf
  • ovos_config/recommends/base/no-no.conf
  • ovos_config/recommends/base/sv-se.conf
  • ovos_config/recommends/offline_male/no-no.conf
  • ovos_config/recommends/online_male/da-dk.conf
  • ovos_config/recommends/online_male/no-no.conf
  • ovos_config/recommends/online_male/sv-se.conf
  • ovos_config/recommends/online_stt/no-no.conf
🔇 Additional comments (9)
ovos_config/recommends/online_stt/da-dk.conf (2)

1-6: LGTM! The configuration structure is valid and well-formatted.

The JSON structure follows the expected format for STT configuration.


3-3: Verify compatibility with Danish language.

Let's verify that the specified STT module supports Danish (da-dk) language processing.

ovos_config/recommends/offline_male/da-dk.conf (2)

1-8: LGTM! Configuration structure is valid.

The JSON configuration follows the expected structure for TTS settings.


5-5: Verify voice model compatibility with Danish language.

Please confirm that the nst_talesyntese-medium voice model is appropriate for Danish TTS and provides good quality output.

ovos_config/recommends/offline_male/se-sv.conf (1)

1-8: JSON structure looks good.

The configuration structure follows the expected pattern for TTS settings.

ovos_config/recommends/offline_stt/da-dk.conf (1)

1-9: Verify the scope of this PR.

The PR title mentions adding support for Sweden and Norway, but this file configures Danish (da-dk) STT. Please clarify if Danish support is intentionally part of this PR's scope.

✅ Verification successful

Let me check the content of the Norwegian and Swedish config files to ensure they are similar to the Danish one and part of the same PR changes.


Danish STT config was added in a separate commit, but is related to the Nordic languages support

The git history shows that Danish support was added first in commit 1d5f22b, followed by Norwegian and Swedish support in commit 2a42ade. While the PR title only mentions Sweden and Norway, the Danish config is closely related as part of the Nordic languages support. All three configs use the same STT configuration with the FasterWhisper plugin.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if other Nordic language configs are present
# Expected: Should find no-no.conf and sv-se.conf

echo "Checking for Norwegian and Swedish configs..."
fd -e conf "no-no|sv-se" ovos_config/recommends/offline_stt/

echo -e "\nChecking commit message for context..."
git log -1 --pretty=%B

Length of output: 401


Script:

#!/bin/bash
# Check contents of Nordic language config files
echo "=== Content of Norwegian config ==="
cat ovos_config/recommends/offline_stt/no-no.conf

echo -e "\n=== Content of Swedish config ==="
cat ovos_config/recommends/offline_stt/sv-se.conf

# Check git changes to see if all three files were added in this PR
echo -e "\n=== Git changes for these files ==="
git log --oneline --stat -- ovos_config/recommends/offline_stt/da-dk.conf ovos_config/recommends/offline_stt/no-no.conf ovos_config/recommends/offline_stt/sv-se.conf

Length of output: 1155

ovos_config/recommends/offline_stt/no-no.conf (1)

1-9: LGTM! Valid JSON structure and configuration hierarchy.

The configuration follows the expected format for OVOS STT settings.

ovos_config/recommends/offline_stt/sv-se.conf (2)

5-7: Evaluate if "small" model is optimal for Swedish.

The "small" model might not provide the best accuracy for Swedish language processing. Consider testing with larger models (base, medium, or large) to find the optimal balance between performance and accuracy for Swedish language support.

#!/bin/bash
# Description: Check if other language configs use different model sizes
# Test: Search for model size configurations in other language configs
rg -A 2 '"model":' ovos_config/recommends/offline_stt/

3-3: Verify Swedish language support in the plugin.

Let's confirm that ovos-stt-plugin-fasterwhisper supports Swedish language processing.

Comment on lines 1 to 8
{
"tts": {
"module": "ovos-tts-plugin-piper",
"ovos-tts-plugin-piper": {
"voice": "nst_talesyntese-medium"
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Incorrect language code in filename.

The filename uses "se-sv" which is incorrect for Swedish. The ISO 639-1/ISO 3166-1 language code for Swedish (Sweden) should be "sv-SE". The file should be renamed accordingly.

Rename the file from se-sv.conf to sv-SE.conf.

Comment on lines 4 to 6
"ovos-tts-plugin-piper": {
"voice": "nst_talesyntese-medium"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Inappropriate voice model for Swedish TTS.

The configuration uses "nst_talesyntese-medium" which appears to be a Norwegian voice model (NST = Norsk Språkteknologi). This is inappropriate for Swedish text-to-speech.

Please use an appropriate Swedish voice model. Common Swedish voices available in Piper include:

  • "talesyntese_sv_se_nst-medium"
  • "sv_se_nst_medium"

Example configuration:

  "ovos-tts-plugin-piper": {
-    "voice": "nst_talesyntese-medium"
+    "voice": "talesyntese_sv_se_nst-medium"
  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"ovos-tts-plugin-piper": {
"voice": "nst_talesyntese-medium"
}
"ovos-tts-plugin-piper": {
"voice": "talesyntese_sv_se_nst-medium"
}

ovos_config/locale.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant