Coder Social home page Coder Social logo

libras's Introduction

Libras

Translation service between a spoken and a signed language.

Prerequisites

Optionally, this application, the database and all the different tests can be build and run in Docker.

To build and run only the database components in Docker, execute:

docker-compose up -d mongo mongo-seed mongo-express

Setup

Install project dependencies:

npm install

Create an .env file and set the IBM Cloud Natural Language Understanding service URL and API key by replacing <NLU_URL> and <NLU_API_KEY>:

NLU_URL=<NLU_URL>
NLU_API_KEY=<NLU_API_KEY>

Customize

Create an .env file to start the application in cluster mode, change its running port, log level, directory and maximum size. The variable names and default values are:

CLUSTER_MODE=false
PORT=3000
LOG_ENABLED=true
LOG_LEVEL=info
LOG_DIR=logs
LOG_MAX_SIZE=10m
LOG_MAX_FILES=7d

Change MongoDB connection by specifying MONGODB_HOSTNAME and MONGODB_PORT values in .env file. The default values are:

MONGODB_HOSTNAME=localhost
MONGODB_PORT=27017

Run

Start the application:

npm start

Access localhost:3000/docs to check the API documentation.

Test

Run code style, unit, integration and security tests:

npm test

Code Coverage

Generate code coverage test report:

npm run cover

When reports are created, coverage/lcov-report/index.html can be opened in a web browser.

Performance Tests

Run performance tests:

npm run test:performance

When performance tests are completed, generate report:

npm run performance:report

logs/performance.log.html should open in a web browser.

libras's People

Contributors

filipecorrea avatar marcobarrera avatar stevemar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

libras's Issues

Natural Language Processing for Language Translation

Is your feature request related to a problem? Please describe.
It is not clear if the current method used for language translation is the best approach.

Obs.: Is there have any document or explanation of how the translation has been handle?

Describe the solution you'd like
Lately, deep learning techniques are giving excellent results for translation. The most notorious implementation is the Seq2Seq, where it is trained by receiving pairs of sentences from both languages. With the model trained, it will be capable of transforming one sentence from one language to the other one.

Describe alternatives you've considered
There are multiple alternatives to implement Seq2Seq:

The two problems, how to make it available and enough data to have high accuracy.

About models, it's crucial to properly manage it by scheduled training, constant evaluation, and improvement. I do believe that we can use Watson Data Studio to build and deploy, and Watson Machine Learning to expose.

Regarding data, I suggest to open another issue and define strategies to collect it.

Additional context

Infrastructure Overview

img

img2

Add unit tests for bad request error

Is your feature request related to a problem? Please describe.
The code in src/errors/bad-request.js is not properly covered by unit tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Add unit tests for MongoDB connector

Is your feature request related to a problem? Please describe.
The code in src/databases/mongo.js is not properly covered by unit tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Developers should have a way of mocking the database

Is your feature request related to a problem? Please describe.
I'm always frustrated when the database is mandatory to run the project for local development.

Describe the solution you'd like
Developers should have a way of mocking the API if they're only developing the API.

Add unit tests for languages controller

Is your feature request related to a problem? Please describe.
The code in src/controllers/languages is not properly covered by unit tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Add unit tests for languages routes

Is your feature request related to a problem? Please describe.
The code in src/routes/languages is not properly covered by unit tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Add integration tests for languages API

Is your feature request related to a problem? Please describe.
The languages API are not properly covered by integration tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Add unit tests for logger

Is your feature request related to a problem? Please describe.
The code in src/logger is not properly covered by unit tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Add unit tests for translate routes

Is your feature request related to a problem? Please describe.
The code in src/routes/translate is not properly covered by unit tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Remove components directory

Is your feature request related to a problem? Please describe.
There're no other components in src/components to justify the use of this directory.

Describe the solution you'd like
The src/components/logger.js file should be moved to src/logger/index.js.

Add integration tests for translate API

Is your feature request related to a problem? Please describe.
The translate API are not properly covered by integration tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Cache NLU service

Is your feature request related to a problem? Please describe.
NLU service free tier is limited so it would be good to have some sort of cache for it.

Describe the solution you'd like
Cache recent requests to this service.

Translation error

Registered phrases

[
    {
        "libras": "onde controle remoto?",
        "pt": "onde está o controle remoto?"
    },
    {
        "libras": "Aborto igreja proibir.",
        "pt": "A igreja proibe o aborto."
    },
    {
        "libras": "Ela abraçar filho dela",
        "pt": "Ela abraçou o seu filho."
    },
    {
        "libras": "Falar abraço esposa sua.",
        "pt": "Diga a sua esposa que mandei um abraço."
    }
]

Input

Beijo igreja proibir.

Output

[
    "A igreja proíbe Kiss."
]

Add unit tests for cluster

Is your feature request related to a problem? Please describe.
The code in src/cluster.js is not properly covered by unit tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Document the translation flow

Is your feature request related to a problem? Please describe.
Developers are having a hard time to understand the translation process.

Describe the solution you'd like
A better documentation on the translation flow will help new developers to understand the project faster.

Describe alternatives you've considered

  • Wiki document;
  • Diagram.

Support multiple languages

Is your feature request related to a problem? Please describe.
At this moment, Libras service only works for English & ASL texts.

Describe the solution you'd like
The service should support multiple languages like Portuguese & LIBRAS.

Handle config validation errors

Is your feature request related to a problem? Please describe.
The config module (src/config) throws regular errors for validation errors:

throw new Error(`Config validation error: ${error.message}`)

Describe the solution you'd like
A ConfigValidationError could be used for a better error handling.

Improve the way we handle ambiguity

For example
The following registered phrase:

igreja aborto proibir.
It brings many possibilities:

["O aborto proíbe a igreja.","O guidão da igreja quebrou.","Desculpem-me, a proibição é um aborto.","Na Bahia, o aborto das pessoas é negro.","igreja adora proibição.","O aborto da gasolina aumentou.","A igreja comprou uma proibição."]

Add unit tests for text controller

Is your feature request related to a problem? Please describe.
The code in src/controllers/text is not properly covered by unit tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

Add unit tests for translations controller

Is your feature request related to a problem? Please describe.
The code in src/controllers/translations is not properly covered by unit tests.

Describe the solution you'd like
Use the existing test framework to write unit tests for this component.

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.