2aa9b3cebc570bb0e9b444c1e3935255e771188e,keyword_spotting_data_generator/evaluation/evaluation_data_generator.py,,main,#,20

Before Change


        try:
            video = PyTube(utils.get_youtube_url(url))
        except Exception as exception:
            cp.print_error("failed to generate PyTube representation for vidoe ", url)
            continue
        if int(video.length) > args.video_length:
            continue

After Change


            srt_captions = caption.generate_srt_captions().split("\n\n")
        except Exception as exception:
            cp.print_error("failed to retrieve srt for video - ", url)
            cp.print_error(exception)
            continue

        translator = str.maketrans("", "", string.punctuation) // to remove punctuation
        srt_tag_re = re.compile(r"<.*?>|\(.*?\)|\[.*?\]")

        keyword_exist = False
        for captions in srt_captions:
            if keyword in captions or plural.plural(keyword) in captions:
                keyword_exist = True
                break

        if not keyword_exist:
            cp.print_warning("keywords never appear in the video - ", url)
            continue

        try:
            crawler = YoutubeCrawler(url)
            audio_data = crawler.get_audio()
        except Exception as exception:
            cp.print_error("failed to download audio file for video ", url)
            cp.print_warning(exception)
            continue

        collected_data = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: castorini/honk
Commit Name: 2aa9b3cebc570bb0e9b444c1e3935255e771188e
Time: 2019-02-07
Author: ljj7975@gmail.com
File Name: keyword_spotting_data_generator/evaluation/evaluation_data_generator.py
Class Name:
Method Name: main


Project Name: polyaxon/polyaxon
Commit Name: 91e7eb2a61473531cc5dcdd378c8bd5dc03a4554
Time: 2017-12-14
Author: mouradmourafiq@gmail.com
File Name: polyaxon_cli/cli/init.py
Class Name:
Method Name: init


Project Name: polyaxon/polyaxon
Commit Name: 1593cbf402aff9c7e41564d30f9ca177995cdce6
Time: 2020-04-26
Author: mouradmourafiq@gmail.com
File Name: core/polyaxon/cli/errors.py
Class Name:
Method Name: handle_cli_error