Code Monkey home page Code Monkey logo

captionfixer's Introduction

CaptionFixer

Simple tool for fixing auto-generated captions in the VTT format using the original script

Usage

./fix_captions <captionfile.vtt> <scriptfile.txt>

The modified file is saved in captionfile.new.vtt

Functionality

The tool is simple. At its core it just:

  1. does Sequence Alignment on the texts of the vtt and txt files
  2. uses the alignment to replace the captions text with the script text, while keeping timestamps unchanged

The tool also does some simple substitutions, hardcoded in _COMMON_SUBS in fix_captions.py. It also treats common homonyms as identical for sequence alignment purposes.

Output

If the original and modified captions for each timestamp are similar enough, CaptionFixer takes a leap of faith and replaces the original caption.

Otherwise, both the original and modified captions are printed, prefixed with "---" and "+++" respectively.

Finally, if the original caption contained text that does not match the script, e.g., because the speaker went off script, the modified caption will keep that text but now ounded by "*". For example:

Script:

This is what makes C++ better that all other languages.

Original caption:

This is what makes c plus plus better than all other languages assuming of course that you use a very narrow definition of better

Modified caption:

This is what makes C++ better that all other languages. *assuming of course that you use a very narrow definition of better*

captionfixer's People

Contributors

ppetoumenos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.