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

Degraded translation in main compared to packaged 1.9.6 for fr->en translation #456

Open
yudelevi opened this issue Jan 7, 2025 · 1 comment

Comments

@yudelevi
Copy link
Contributor

yudelevi commented Jan 7, 2025

Code snippet:

import argostranslate.package
import argostranslate.translate
from_code = "fr"
to_code = "en"
text="""Win in the platform world | Publicis Groupe Sections Communiqués de presse News Documents financiers Autres Date de publication Année Aucun résultat ne correspond à votre recherche News Communiqués de presse Fil d'actualités Les créations Le groupe A propos de Publicis Groupe Gouvernance RSE Histoire Viva Technology Carrières Services Investisseurs & analystes Nos chiffres-clés Actionnaires Données boursières FR EN Subscribe Sign up to receive the Publicis Groupe newsletter Submit Win in the platform world Publicis connecte toutes ses expertises de manière intégrée grâce au Power of One, pour accompagner ses clients et les aider à gagner dans un monde de plateformes. Arthur Sadoun En savoir plus sur Publicis"""

# Download and install Argos Translate package
argostranslate.package.update_package_index()
available_packages = argostranslate.package.get_available_packages()
package_to_install = next(
    filter(
        lambda x: x.from_code == from_code and x.to_code == to_code, available_packages
    )
)
argostranslate.package.install_from_path(package_to_install.download())

# Translate
translatedText = argostranslate.translate.translate(text, from_code, to_code)

Packaged 1.9.6 output:

('sentences', ["Win in the platform world | Publicis Groupe Sections Communiqués de presse News Documents financiers Autres Date de publication Année Aucun résultat ne correspond à votre recherche News Communiqués de presse Fil d'actualités", 'Les créations Le groupe A propos de Publicis Groupe Gouvernance RSE Histoire Viva Technology Carrières Services Investisseurs & analystes Nos chiffres-clés Actionnaires Données boursières FR EN Subscribe Sign up to receive the Publicis Groupe newsletter Submit Win in the platform world Publicis connecte toutes ses expertises de manière intégrée grâce au Power of One, pour accompagner ses clients et les aider à gagner dans un monde de plateformes.', 'Arthur Sadoun En savoir plus sur Publicis'])
('tokenized', [['▁Win', '▁in', '▁the', '▁plat', 'form', '▁', 'world', '▁|', '▁Public', 'is', '▁Groupe', '▁Section', 's', '▁Communiqués', '▁de', '▁presse', '▁News', '▁Documents', '▁financiers', '▁Autres', '▁Date', '▁de', '▁publication', '▁Année', '▁Aucun', '▁résultat', '▁ne', '▁correspond', '▁à', '▁votre', '▁recherche', '▁News', '▁Communiqués', '▁de', '▁presse', '▁Fil', '▁d', "'", 'actualité', 's'], ['▁Les', '▁création', 's', '▁Le', '▁groupe', '▁A', '▁propos', '▁de', '▁Public', 'is', '▁Groupe', '▁Gouvernance', '▁RSE', '▁Histoire', '▁Viv', 'a', '▁Technology', '▁Carrières', '▁Services', '▁Invest', 'isseur', 's', '▁&', '▁analystes', '▁Nos', '▁chiffres', '-', 'clés', '▁Action', 'naires', '▁Données', '▁b', 'ours', 'ières', '▁FR', '▁EN', '▁Sub', 's', 'cri', 'be', '▁Sign', '▁', 'up', '▁to', '▁re', 'ce', 'ive', '▁the', '▁Public', 'is', '▁Groupe', '▁newsletter', '▁Sub', 'mit', '▁Win', '▁in', '▁the', '▁plat', 'form', '▁', 'world', '▁Public', 'is', '▁connecte', '▁toutes', '▁ses', '▁expertise', 's', '▁de', '▁manière', '▁intégrée', '▁grâce', '▁au', '▁Power', '▁of', '▁One', ',', '▁pour', '▁accompagner', '▁ses', '▁clients', '▁et', '▁les', '▁aider', '▁à', '▁gagner', '▁dans', '▁un', '▁monde', '▁de', '▁plateformes', '.'], ['▁Arthur', '▁S', 'ado', 'un', '▁En', '▁savoir', '▁plus', '▁sur', '▁Public', 'is']])
('translated_batches', [TranslationResult(hypotheses=[['▁Win', '▁in', '▁the', '▁platform', '▁world']], scores=[-4.501098155975342], attention=[], logits=[]), TranslationResult(hypotheses=[['▁Creation', 's', '▁The', '▁Group', '▁About', '▁Public', 'is', '▁Group', '▁Governance', '▁CSR', '▁History', '▁Viv', 'a', '▁Technology', '▁Careers', '▁Services', '▁Investor', 's', '▁&', '▁analysts', '▁Our', '▁key', '▁figures', '▁Share', 'holders', '▁Stock', '▁market', '▁data', '▁FR', '▁EN', '▁Subscribe', '▁Sign', '▁up', '▁to', '▁receive', '▁the', '▁Public', 'is', '▁Group', '▁Newsletter', '▁Submit', '▁Win', '▁in', '▁the', '▁platform', '▁world', '▁Public', 'is', '▁connect', 's', '▁all', '▁its', '▁expertise', '▁in', '▁an', '▁integrated', '▁way', '▁with', '▁Power', '▁of', '▁One', ',', '▁to', '▁support', '▁its', '▁customers', '▁and', '▁help', '▁them', '▁win', '▁in', '▁a', '▁world', '▁of', '▁platforms', '.']], scores=[-9.005094528198242], attention=[], logits=[]), TranslationResult(hypotheses=[['▁Arthur', '▁Sad', 'oun', '▁Learn', '▁more', '▁about', '▁Public', 'is']], scores=[-1.0381593704223633], attention=[], logits=[])])
('value_hypotheses:', [('Win in the platform world Creations The Group About Publicis Group Governance CSR History Viva Technology Careers Services Investors & analysts Our key figures Shareholders Stock market data FR EN Subscribe Sign up to receive the Publicis Group Newsletter Submit Win in the platform world Publicis connects all its expertise in an integrated way with Power of One, to support its customers and help them win in a world of platforms. Arthur Sadoun Learn more about Publicis', -14.544352054595947)])
('translated_paragraphs:', [[('Win in the platform world Creations The Group About Publicis Group Governance CSR History Viva Technology Careers Services Investors & analysts Our key figures Shareholders Stock market data FR EN Subscribe Sign up to receive the Publicis Group Newsletter Submit Win in the platform world Publicis connects all its expertise in an integrated way with Power of One, to support its customers and help them win in a world of platforms. Arthur Sadoun Learn more about Publicis', -14.544352054595947)]])
('hypotheses_to_return:', [('Win in the platform world Creations The Group About Publicis Group Governance CSR History Viva Technology Careers Services Investors & analysts Our key figures Shareholders Stock market data FR EN Subscribe Sign up to receive the Publicis Group Newsletter Submit Win in the platform world Publicis connects all its expertise in an integrated way with Power of One, to support its customers and help them win in a world of platforms. Arthur Sadoun Learn more about Publicis', -14.544352054595947)])

Main branch:

('paragraphs:', ["Win in the platform world | Publicis Groupe Sections Communiqués de presse News Documents financiers Autres Date de publication Année Aucun résultat ne correspond à votre recherche News Communiqués de presse Fil d'actualités Les créations Le groupe A propos de Publicis Groupe Gouvernance RSE Histoire Viva Technology Carrières Services Investisseurs & analystes Nos chiffres-clés Actionnaires Données boursières FR EN Subscribe Sign up to receive the Publicis Groupe newsletter Submit Win in the platform world Publicis connecte toutes ses expertises de manière intégrée grâce au Power of One, pour accompagner ses clients et les aider à gagner dans un monde de plateformes. Arthur Sadoun En savoir plus sur Publicis"])
('apply_packaged_translation', "Win in the platform world | Publicis Groupe Sections Communiqués de presse News Documents financiers Autres Date de publication Année Aucun résultat ne correspond à votre recherche News Communiqués de presse Fil d'actualités Les créations Le groupe A propos de Publicis Groupe Gouvernance RSE Histoire Viva Technology Carrières Services Investisseurs & analystes Nos chiffres-clés Actionnaires Données boursières FR EN Subscribe Sign up to receive the Publicis Groupe newsletter Submit Win in the platform world Publicis connecte toutes ses expertises de manière intégrée grâce au Power of One, pour accompagner ses clients et les aider à gagner dans un monde de plateformes. Arthur Sadoun En savoir plus sur Publicis")
('sentences', ["Win in the platform world | Publicis Groupe Sections Communiqués de presse News Documents financiers Autres Date de publication Année Aucun résultat ne correspond à votre recherche News Communiqués de presse Fil d'actualités Les créations Le groupe A propos de Publicis Groupe Gouvernance RSE Histoire Viva Technology Carrières Services Investisseurs & analystes Nos chiffres-clés Actionnaires Données boursières FR EN Subscribe Sign up to receive the Publicis Groupe newsletter Submit Win in the platform world Publicis connecte toutes ses expertises de manière intégrée gr̂ace au Power of One, pour accompagner ses clients et les aider à gagner dans un monde de plateformes.", 'Arthur Sadoun', 'En savoir plus sur Publicis'])
('tokenized', [['▁Win', '▁in', '▁the', '▁plat', 'form', '▁', 'world', '▁|', '▁Public', 'is', '▁Groupe', '▁Section', 's', '▁Communiqués', '▁de', '▁presse', '▁News', '▁Documents', '▁financiers', '▁Autres', '▁Date', '▁de', '▁publication', '▁Année', '▁Aucun', '▁résultat', '▁ne', '▁correspond', '▁à', '▁votre', '▁recherche', '▁News', '▁Communiqués', '▁de', '▁presse', '▁Fil', '▁d', "'", 'actualité', 's', '▁Les', '▁création', 's', '▁Le', '▁groupe', '▁A', '▁propos', '▁de', '▁Public', 'is', '▁Groupe', '▁Gouvernance', '▁RSE', '▁Histoire', '▁Viv', 'a', '▁Technology', '▁Carrières', '▁Services', '▁Invest', 'isseur', 's', '▁&', '▁analystes', '▁Nos', '▁chiffres', '-', 'clés', '▁Action', 'naires', '▁Données', '▁b', 'ours', 'ières', '▁FR', '▁EN', '▁Sub', 's', 'cri', 'be', '▁Sign', '▁', 'up', '▁to', '▁re', 'ce', 'ive', '▁the', '▁Public', 'is', '▁Groupe', '▁newsletter', '▁Sub', 'mit', '▁Win', '▁in', '▁the', '▁plat', 'form', '▁', 'world', '▁Public', 'is', '▁connecte', '▁toutes', '▁ses', '▁expertise', 's', '▁de', '▁manière', '▁intégrée', '▁grâce', '▁au', '▁Power', '▁of', '▁One', ',', '▁pour', '▁accompagner', '▁ses', '▁clients', '▁et', '▁les', '▁aider', '▁à', '▁gagner', '▁dans', '▁un', '▁monde', '▁de', '▁plateformes', '.'], ['▁Arthur', '▁S', 'ado', 'un'], ['▁En', '▁savoir', '▁plus', '▁sur', '▁Public', 'is']])
('translated_batches', [TranslationResult(hypotheses=[['▁Win', '▁in', '▁the', '▁platform', '▁world']], scores=[-4.811287879943848], attention=[], logits=[]), TranslationResult(hypotheses=[['▁Arthur', '▁Sad', 'oun']], scores=[-0.24370838701725006], attention=[], logits=[]), TranslationResult(hypotheses=[['▁Learn', '▁more', '▁about', '▁Public', 'is']], scores=[-0.812721312046051], attention=[], logits=[])])
('value_hypotheses:', [('Win in the platform world Arthur Sadoun Learn more about Publicis', -5.867717579007149)])
('translated_paragraphs:', [[('Win in the platform world Arthur Sadoun Learn more about Publicis', -5.867717579007149)]])
('hypotheses_to_return:', [('Win in the platform world Arthur Sadoun Learn more about Publicis', -5.867717579007149)])

As I was typing this it came to mind that the '|' symbol might be causing this, and it seems like it's confirmed

('get_installed_languages',)
('paragraphs:', ["Win in the platform world Publicis Groupe Sections Communiqués de presse News Documents financiers Autres Date de publication Année Aucun résultat ne correspond à votre recherche News Communiqués de presse Fil d'actualités Les créations Le groupe A propos de Publicis Groupe Gouvernance RSE Histoire Viva Technology Carrières Services Investisseurs & analystes Nos chiffres-clés Actionnaires Données boursières FR EN Subscribe Sign up to receive the Publicis Groupe newsletter Submit Win in the platform world Publicis connecte toutes ses expertises de manière intégrée gr̂ace au Power of One, pour accompagner ses clients et les aider à gagner dans un monde de plateformes. Arthur Sadoun En savoir plus sur Publicis"])
('apply_packaged_translation', "Win in the platform world Publicis Groupe Sections Communiqués de presse News Documents financiers Autres Date de publication Année Aucun résultat ne correspond à votre recherche News Communiqués de presse Fil d'actualités Les créations Le groupe A propos de Publicis Groupe Gouvernance RSE Histoire Viva Technology Carrières Services Investisseurs & analystes Nos chiffres-clés Actionnaires Données boursières FR EN Subscribe Sign up to receive the Publicis Groupe newsletter Submit Win in the platform world Publicis connecte toutes ses expertises de manière intégrée grâce au Power of One, pour accompagner ses clients et les aider à gagner dans un monde de plateformes. Arthur Sadoun En savoir plus sur Publicis")
('sentences', ["Win in the platform world Publicis Groupe Sections Communiqués de presse News Documents financiers Autres Date de publication Année Aucun résultat ne correspond à votre recherche News Communiqués de presse Fil d'actualités Les créations Le groupe A propos de Publicis Groupe Gouvernance RSE Histoire Viva Technology Carrières Services Investisseurs & analystes Nos chiffres-clés Actionnaires Données boursières FR EN Subscribe Sign up to receive the Publicis Groupe newsletter Submit Win in the platform world Publicis connecte toutes ses expertises de manière intégrée grâce au Power of One, pour accompagner ses clients et les aider à gagner dans un monde de plateformes.", 'Arthur Sadoun', 'En savoir plus sur Publicis'])
('tokenized', [['▁Win', '▁in', '▁the', '▁plat', 'form', '▁', 'world', '▁Public', 'is', '▁Groupe', '▁Section', 's', '▁Communiqués', '▁de', '▁presse', '▁News', '▁Documents', '▁financiers', '▁Autres', '▁Date', '▁de', '▁publication', '▁Année', '▁Aucun', '▁résultat', '▁ne', '▁correspond', '▁à', '▁votre', '▁recherche', '▁News', '▁Communiqués', '▁de', '▁presse', '▁Fil', '▁d', "'", 'actualité', 's', '▁Les', '▁création', 's', '▁Le', '▁groupe', '▁A', '▁propos', '▁de', '▁Public', 'is', '▁Groupe', '▁Gouvernance', '▁RSE', '▁Histoire', '▁Viv', 'a', '▁Technology', '▁Carrières', '▁Services', '▁Invest', 'isseur', 's', '▁&', '▁analystes', '▁Nos', '▁chiffres', '-', 'clés', '▁Action', 'naires', '▁Données', '▁b', 'ours', 'ières', '▁FR', '▁EN', '▁Sub', 's', 'cri', 'be', '▁Sign', '▁', 'up', '▁to', '▁re', 'ce', 'ive', '▁the', '▁Public', 'is', '▁Groupe', '▁newsletter', '▁Sub', 'mit', '▁Win', '▁in', '▁the', '▁plat', 'form', '▁', 'world', '▁Public', 'is', '▁connecte', '▁toutes', '▁ses', '▁expertise', 's', '▁de', '▁manière', '▁intégrée', '▁grâce', '▁au', '▁Power', '▁of', '▁One', ',', '▁pour', '▁accompagner', '▁ses', '▁clients', '▁et', '▁les', '▁aider', '▁à', '▁gagner', '▁dans', '▁un', '▁monde', '▁de', '▁plateformes', '.'], ['▁Arthur', '▁S', 'ado', 'un'], ['▁En', '▁savoir', '▁plus', '▁sur', '▁Public', 'is']])
('translated_batches', [TranslationResult(hypotheses=[['▁Win', '▁in', '▁the', '▁platform', '▁world', '▁Public', 'is', '▁Group', '▁Sections', '▁Press', '▁releases', '▁News', '▁Financial', '▁documents', '▁Other', '▁Publication', '▁date', '▁Year', '▁No', '▁results', '▁match', '▁your', '▁search', '▁News', '▁Press', '▁releases', '▁News', '▁feed', '▁Creation', 's', '▁The', '▁group', '▁About', '▁Public', 'is', '▁Group', '▁Governance', '▁CSR', '▁History', '▁Viv', 'a', '▁Technology', '▁Careers', '▁Services', '▁Investor', 's', '▁&', '▁analysts', '▁Our', '▁key', '▁figures', '▁Share', 'holders', '▁Stock', '▁market', '▁data', '▁FR', '▁EN', '▁Subscribe', '▁Sign', '▁up', '▁to', '▁receive', '▁the', '▁Public', 'is', '▁Group', '▁newsletter', '▁Submit', '▁Win', '▁in', '▁the', '▁platform', '▁world', '▁Public', 'is', '▁connect', 's', '▁all', '▁its', '▁expertise', '▁in', '▁an', '▁integrated', '▁way', '▁thanks', '▁to', '▁Power', '▁of', '▁One', ',', '▁to', '▁support', '▁its', '▁customers', '▁and', '▁help', '▁them', '▁win', '▁in', '▁a', '▁world', '▁of', '▁platforms', '.']], scores=[-10.353989601135254], attention=[], logits=[]), TranslationResult(hypotheses=[['▁Arthur', '▁Sad', 'oun']], scores=[-0.24370838701725006], attention=[], logits=[]), TranslationResult(hypotheses=[['▁Learn', '▁more', '▁about', '▁Public', 'is']], scores=[-0.812721312046051], attention=[], logits=[])])
('value_hypotheses:', [('Win in the platform world Publicis Group Sections Press releases News Financial documents Other Publication date Year No results match your search News Press releases News feed Creations The group About Publicis Group Governance CSR History Viva Technology Careers Services Investors & analysts Our key figures Shareholders Stock market data FR EN Subscribe Sign up to receive the Publicis Group newsletter Submit Win in the platform world Publicis connects all its expertise in an integrated way thanks to Power of One, to support its customers and help them win in a world of platforms. Arthur Sadoun Learn more about Publicis', -11.410419300198555)])
('translated_paragraphs:', [[('Win in the platform world Publicis Group Sections Press releases News Financial documents Other Publication date Year No results match your search News Press releases News feed Creations The group About Publicis Group Governance CSR History Viva Technology Careers Services Investors & analysts Our key figures Shareholders Stock market data FR EN Subscribe Sign up to receive the Publicis Group newsletter Submit Win in the platform world Publicis connects all its expertise in an integrated way thanks to Power of One, to support its customers and help them win in a world of platforms. Arthur Sadoun Learn more about Publicis', -11.410419300198555)]])
('hypotheses_to_return:', [('Win in the platform world Publicis Group Sections Press releases News Financial documents Other Publication date Year No results match your search News Press releases News feed Creations The group About Publicis Group Governance CSR History Viva Technology Careers Services Investors & analysts Our key figures Shareholders Stock market data FR EN Subscribe Sign up to receive the Publicis Group newsletter Submit Win in the platform world Publicis connects all its expertise in an integrated way thanks to Power of One, to support its customers and help them win in a world of platforms. Arthur Sadoun Learn more about Publicis', -11.410419300198555)])```
@yudelevi
Copy link
Contributor Author

yudelevi commented Jan 8, 2025

I'm not sure this is helping anybody, but I managed to reproduce the same issue with the following chars : ⋮‣●|.́

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

No branches or pull requests

1 participant