Giter VIP home page Giter VIP logo

subtitle-translator-nestjs-with-nx.dev's Introduction

Run

Please check start-app.md for running the App.

Description

Project uses NX.dev monorepo architecture. A Subtitles Translator project is a attempt to translates subtitles, it takes one or several subtitle files as input and produces the subtitles in the same format containing the translations of each one of the contained sentences.

Contains REST API for uploading subtitles in a plain text format (.txt) and send an email with the translation as attachment once the process done. TMS databank endpoint is also part of http app for getting new translations.

The translation is performed by using historical data stored in a Translation Management System (TMS) One translation is performed by going through the following steps:

1 - Parses the subtitles file and extract the translatable source. 2 - Translates the source using historical data. 3 - Pairs the result with the source. 4 - Reconstructs the subtitles file.

Example processing input of TMS:

1 [00:00:12.00 - 00:01:20.00] I am Arwen - I've come to help you.
2 [00:03:55.00 - 00:04:20.00] Come back to the light.
3 [00:04:59.00 - 00:05:30.00] Nooo, my precious!!.

The output for this input would be a file containing something as:

1 [00:00:12.00 - 00:01:20.00] Ich bin Arwen - Ich bin gekommen, um dir zu helfen.
2 [00:03:55.00 - 00:04:20.00] Komm zurück zum Licht.
3 [00:04:59.00 - 00:05:30.00] Nein, my Schatz!!.

In order to translate a query, it uses the following flow:

1 - Search for strings that are approximately equal in the database — They might not be the same but close enough to be consider a translation.

2 - It calculates the distance between the query and the closest string found. — A standard way of calculating strings distance is by using Levenshtein distance algorithm. 3 - If the distance is less than 5, is considered a translation, otherwise the same query is returned as result.

Import interface of TMS

[
  {
    "source": "Hello World",
    "target": "Hallo Welt",
		"sourceLanguage": "en",
		"targetLanguage": "de"
  },
  {
    "source": "Hello guys",
    "target": "Hallo Leute",
		"sourceLanguage": "en",
		"targetLanguage": "de"
  },
  {
    "source": "I walk to the supermarket",
    "target": "Ich gehe zum Supermarkt.",
		"sourceLanguage": "en",
		"targetLanguage": "de"
  }
]

License

MIT License

subtitle-translator-nestjs-with-nx.dev's People

Contributors

yeomann 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.