-
Notifications
You must be signed in to change notification settings - Fork 36
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
Feat: Visualization tool #107
Conversation
…ed visualize.py via argparse. Now user may add --visualize in the terminal to have the graph output to the output folder
… .png file. Add ability to read multiple dictionaries from instances.log
Hi @Epic-Eric! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Hi @Epic-Eric, thanks for the PR! It looks good in general! A few suggestion
|
@@ -125,8 +125,8 @@ class IterableDataloader: | |||
|
|||
@abstractmethod | |||
def __iter__(self): | |||
... | |||
pass |
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.
Changed to pass, since the 3.7 and 3.8 Python's black formatters have different versions and they treat this ellipsis differently. The keyword pass
also implies coming back to this code later on.
pytest simuleval/test/test_evaluator.py | ||
pytest simuleval/test/test_remote_evaluation.py | ||
pytest simuleval/test/test_s2s.py | ||
pytest simuleval/test/test_visualize.py |
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.
Black's formatting
@@ -40,6 +40,8 @@ | |||
"bitarray==2.6.0", | |||
"yt-dlp", | |||
"pydub", | |||
"openai-whisper", | |||
"editdistance", | |||
], |
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.
Needed for running whisper
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.
Hi Eric, could you remove the dependency on openai-whisper and pip install openai-whisper in test plam?
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.
Sure! Just curious, why don't we put it in setup.py, so the user can run custom audio files?
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.
You mean to put it in main.yaml instead right
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.
Done!
simuleval/evaluator/evaluator.py
Outdated
open(self.output / "instances.log", "a") | ||
if self.output | ||
else contextlib.nullcontext() | ||
) as file: | ||
system.reset() |
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.
Black's formatting
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.
Hi Eric, it looks great! Could address the comments on the openai whipser? After that we can merge the PR
@@ -40,6 +40,8 @@ | |||
"bitarray==2.6.0", | |||
"yt-dlp", | |||
"pydub", | |||
"openai-whisper", | |||
"editdistance", | |||
], |
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.
Hi Eric, could you remove the dependency on openai-whisper and pip install openai-whisper in test plam?
Description
Use Matplotlib to generate graphs that allow users to visualize speech transcription & translation data.
1st graph: Staircase graph.
Horizontal arrows represent the wait-k delays from reading from the source (s). Vertical arrows represent the output words from writing to the target (words).
2nd graph: Waveform graph.
The waveform is taken from the audio provided, and is displayed below with the x-axis (delay time) in sync with the Staircase graph, which allows convenient comparison and lookup for timestamps of interest.
Related issue: #15, #84
Example inputs
--visualize
in the command line argument, for example:--score-only
command, where it will read data frominstances.log
without running inference, which saves time if you just want the scores.Both commands will generate the corresponding graph in the
output/visual
directoryExample output
Type of change
How Has This Been Tested?
output/visual
directory.Note
brew install sox
(for Mac user)Then:
Then, put
test_22k.wav
insource.txt
and provide its transcript as the reference text inreference/transcript.txt
.Special thanks to:
My MLH Fellowship mentor: @xutaima