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

silence and dna text error #89

Open
joanise opened this issue Nov 3, 2021 · 1 comment
Open

silence and dna text error #89

joanise opened this issue Nov 3, 2021 · 1 comment

Comments

@joanise
Copy link
Member

joanise commented Nov 3, 2021

I created a file with silences and some DNA text, and I get a KeyError with a stack trace trying to align it.

To reproduce: readalongs align data/ej-fra-dna-silence.xml data/ej-fra.m4a sil-dna

data/ej-fra-dna-silence.xml:

<?xml version='1.0' encoding='utf-8'?>
<TEI>
    <!-- To exclude any element from alignment, add the do-not-align="true" attribute to
         it, e.g., <p do-not-align="true">...</p>, or
         <s>Some text <foo do-not-align="true">do not align this</foo> more text</s> -->
    <text xml:lang="fra">
        <body>
            <div type="page">
                <p>
                    <s><silence dur="1"/>Bonjour.</s>
                    <s>Je m'appelle Éric Joanis.</s>
                    <s>Je suis <silence dur="1.382s"></silence> programmeur au sein <silence dur="500ms"></silence> de l'équipe des technologies pour les langues autochtones au CNRC.</s>
                </p>
            </div>
            <div type="page">
		<anchor time="28.6s"/>
                <p do-not-align="true">
                    <s>J'ai fait une bonne partie de ma carrière en traduction automatique statistique, mais maintenant cette approche est déclassée par l'apprentissage profond.</s>
                    <s>En ce moment je travaille à l'alignement du hansard du Nunavut pour produire un corpus bilingue anglais-inuktitut.</s>
                    <s>Ce corpus permettra d'entraîner la TA, neuronale ou statistique, ainsi que d'autres applications de traitement du langage naturel.</s>
                </p>
		<anchor time="50.2s"/>
                <p>
                    <s>En parallèle, j'aide à écrire des tests pour rendre le ReadAlong-Studio plus robuste.</s>
                </p>
            </div>
        </body>
    </text>
</TEI>

Traceback:

Traceback (most recent call last):
  File "C:\Users\joanise\RAS\ras-env\Scripts\readalongs-script.py", line 11, in <module>
    load_entry_point('readalongs', 'console_scripts', 'readalongs')()
  File "c:\users\joanise\ras\ras-env\lib\site-packages\click\core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\joanise\ras\ras-env\lib\site-packages\flask\cli.py", line 596, in main
    return super().main(*args, **kwargs)
  File "c:\users\joanise\ras\ras-env\lib\site-packages\click\core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "c:\users\joanise\ras\ras-env\lib\site-packages\click\core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\joanise\ras\ras-env\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\joanise\ras\ras-env\lib\site-packages\click\core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\joanise\ras\ras-env\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\users\joanise\ras\ras-env\lib\site-packages\flask\cli.py", line 440, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "c:\users\joanise\ras\ras-env\lib\site-packages\click\core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\joanise\ras\studio\readalongs\cli.py", line 267, in align
    verbose_g2p_warnings=kwargs["g2p_verbose"],
  File "c:\users\joanise\ras\studio\readalongs\align.py", line 452, in align_audio
    words_dict[el.attrib["id"]]["end"] * 1000
KeyError: 't0b0d1p0s0w0'
@joanise
Copy link
Member Author

joanise commented Nov 9, 2021

@roedoejet just created branch dev.issue-89 with two test cases for this issue. Delete the @expectedFailure lines in test_silence.py to actually see the errors that happen.

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