pytorch / pytorch/audio

Torchaudio.datasets.COMMONVOICE loader doesn't handle quotes correctly

Open
#2,838 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
799
Avg merge
58m
Merged PRs (30d)
3

Description

🐛 Describe the bug

...Or rather, it handles them correctly according to how a .tsv should be handled but the file doesn't.

Basically the .tsv files for the commonvoice dataset contains sometimes unmatched quotes as a part of the sentence. The torchaudio.datasets.COMMONVOICE loader found here: https://pytorch.org/audio/0.7.0/datasets.html#commonvoice
takes (correctly) quotation marks as a way of escaping the tabs and newlines. That means that some clips have very long sentences that span multiple lines.

I believe this can be resolved by changing the quoting mode passed to the csv reader but I'm not sure if quotes are used elsewhere so maybe something smarter that checks if they appear in the sentence field would be better.

Versions

Latest

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the torchaudio.datasets.COMMONVOICE loader linked in the issue and inspect how its CSV reader handles Common Voice TSV rows containing unmatched quotes. Reproduce the problem with an affected TSV entry, then verify that sentence fields are parsed without incorrectly spanning multiple lines while valid TSV quoting still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.