icefall/egs/voxpopuli/ASR/local/text_from_manifest.py
Karel Vesely 4ec48f30b1 add the voxpopuli recipe
- this is the data preparation
- there is no ASR training and no results
2023-11-07 15:03:23 +01:00

49 lines
1.3 KiB
Python
Executable File

#!/bin/env python3
# Copyright 2023 Brno University of Technology (authors: Karel Veselý)
#
# See ../../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Print the text contained in `supervisions.jsonl.gz`.
Usage example:
python3 ./local/text_from_manifest.py \
data/manifests/voxpopuli-asr-en_supervisions_dev.jsonl.gz
"""
import argparse
import json
import gzip
def get_args():
parser = argparse.ArgumentParser(
"Read the raw text from the 'supervisions.jsonl.gz'"
)
parser.add_argument("filename", help="supervisions.jsonl.gz")
return parser.parse_args()
def main():
args = get_args()
with gzip.open(args.filename, mode="r") as fd:
for line in fd:
js = json.loads(line)
print(js["text"])
if __name__ == "__main__":
main()