Git Product home page Git Product logo

language-learning's Introduction

LibraFranca

This application aims to aid language learning by turning subtitle files into a learning plan!

How it works

It works by taking an uploaded text file, parsing it, and sending a request to an internal translation API

The app then displays translations records in several formats

Translation Mode

In this mode the user sees a translation. They can "flip" it to see the translation in their base language. They can also play the translation with the press of the "Play Translation" button which makes a call to OpenAi's text-to-speech API.

Multiple Choice Mode

In multiple choice mode the user is given a translation in their target language and they are tasked with selecting the correct translation in their base language from the dropdown list

Text-to-speech

This function works by making a call to OpenAi's tts API and handling the response with jquery. This is a very neat feature, and everyone should make sure to check it out!

Technical Details

A user uploads a file and a call is made to the perform function in the app/jobs/parse_file_to_database.rb file. that function parses the file line by line and makes requests to the translation service

Upon success the translation service responds with the translation in the requested language. This translation, along with the original line is committed to a new Translation model record

After some time there can be an intermittent PG::BAD_CONNECTION error, so there is retry logic in place in the perform function to make the job picks up where it left off in the event of this error.

These records can be viewed in the translation mode, multiple choice mode and "need to review" views.

View Locations

  • app/views/homepage/: the views for the instructions and landing pages
  • app/views/learning_paths/: views related to the main view
  • app/views/translations/: views related to individual translations
  • app/views/flashcards/: Views related to the multiple choice mode and translation mode

Controllers

Logic related to what is displayed can generally be found in the controllers section

The tts controller contains a function responsible for making requests to Openai and sending the received binary file to the view where the file is assigned to a (jquery) blob and played immediately

Aside from that the app structure generally follows a typical rails application

language-learning's People

Contributors

andrewhcook avatar

Watchers

 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.