Code Monkey home page Code Monkey logo

kasa's Introduction

Kasa

English to Twi translation library/system being put together by the Ghana NLP team.

Quickstart

Install Kasa directly from online link:

  1. pip install git+https://github.com/GhanaNLP/kasa

When editing Kasa locally, it is helpful to install from a local copy of Kasa instead:

  1. git clone https://github.com/GhanaNLP/kasa

  2. cd kasa

  3. pip install .

The examples/ folder of the repo constains examples you can directly run to test various functionalities, e.g.,

python load_and_preprocess_parallel_dataset.py

This may require obtaining some data files and accordingly passing the right paths to the methods in load_and_preprocess_parallel_dataset.py. All this should be self-explanatory if you look at the code.

Data Files

You will need to download two corpus (English and Twi) into a data folder on your local machine in order to run the examples, using the link below.

https://www.kaggle.com/azunre/jw300entw

Contributing

Please first clone this repo to your local machine, using a command line tool such as Cygwin or Anaconda Prompt:

git clone https://github.com/GhanaNLP/kasa

Create a branch for your contributions, and check it out:

  1. git branch <your-branch-name>

  2. git checkout <your-branch-name>

Try to pick a branch name that described what you are planning to add to the library, see current branch names in this repo for ideas.

Write your code, test it and then push to your branch:

  1. git push origin <your-branch-name>

Create a pull request using the online github repo page, making sure to include a senior member of the team to review your work before merging it into the master branch of the repo.

Never push changes to master!!!

Notebooks

Usually, we start our work by implementing it directly as a Jupyter Python notebook and host it on Kaggle runtime so team members can play around with ideas. Below is a list of the notebooks we have worked on so far, as well as links to where they are hosted on Kaggle so . They are located in the notebooks/ subfolder of this repo, and the hope is to convert all useful methods they contain into refined methods within the Kasa library.

*)The data_processing.ipynb preprocessing notebook is also loaded on kaggle @ https://www.kaggle.com/azunre/ghananlp-kasa-preprocessing-word2vec-v0-1

*)The ghananlp-kasa-retrieval-v0-1.ipynb retrieval "proof-of-concept" notebook is also loaded on kaggle @ https://www.kaggle.com/azunre/ghananlp-kasa-retrieval-v0-

*)The eng_twi_transformer.ipynb transformer-based english-to-twi NMT model notebook is also loaded on kaggle @ https://www.kaggle.com/azunre/ghananlp-kasa-nmt-transformer-v0-1

Description of Key Files

It is helpful to know the function of the following files when contributing:

*)HISTORY.md -- what functionality was added during each version/release, and what is planned to be added next/in the near future.

*)setup.py -- specify dependencies for added methods here

*)__init__.py -- * import specification file, does not exist for now...

*)MANIFEST.in -- (yet to be added) this will be used to make sure required files are copied over when the library is installed (no such requirement yet)

Need More Information on Syntax for Classes, Methods, etc?

The method dir is very useful for debugging your classes and methods, example:

  1. from Kasa import Preprocessing
  2. dir(Preprocessing)

If you need further information, either contact Ghana NLP members directly, or see a repo on github like this one:

https://github.com/algorine/simon

kasa's People

Contributors

azunre avatar hkboateng avatar hotlynnn avatar joelbudu avatar kweku21 avatar lagyamfi avatar salomeyosei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kasa's Issues

Input for special characters on web app

Add the possibility for user to in put special characters for local languages, if they are not available on the keyboard.
The first objective is to implement this on the web app.

An example of this feature is shown on the following website:
https://www.webonary.org/buli/
image

we are using the test server for now to try out the changes on the streamlit app. once all confirmed, we will port it to the public application.

Incompatible shapes

Hi,
Thank you for building and sharing this translation system.
I am trying out the eng_twi_transformer.ipynb using jupyter notebook with the provided data, jw300.en and jw300.tw.
Everything seems to work until I tried to execute the predict function (line 544).

Here are the results on the console:

Epoch 1 Batch 0 Loss 1.9547 Elapsed time 3.26s
Incompatible shapes: [1,74,128] vs. [73,128] [Op:AddV2]
Epoch 2 Batch 0 Loss 1.9929 Elapsed time 10.66s
Incompatible shapes: [1,74,128] vs. [73,128] [Op:AddV2]
...

I am not sure why this happens. Any help or advice is greatly appreciated.
Thank you.

Translation API monetization

We are now able to create products and subscriptions via the Azure API management service which allows access to the API using a subscription key.

We now need to expand on this to create a portal where users can sign-up and access the various subscription packages to our translation API and make payments/ access a free trial.

Acceptance Criteria:

  • The user should be able to sign up and login on to their account.
  • User should be able to select a product and may payment through the Stripe payment provider.

Below are links to resources on how to implement this:

https://docs.microsoft.com/en-us/azure/api-management/monetization-support

https://azure.microsoft.com/en-gb/blog/how-to-monetize-apis-with-azure-api-management/

https://endjin.com/what-we-think/talks/monetize-apis-with-azure-api-management-using-stripe

https://github.com/microsoft/azure-api-management-monetization

https://github.com/microsoft/azure-api-management-monetization/blob/main/documentation/stripe-deploy.md

Create API for Translation app using appropriate Azure feature/services

The goal of this is to migrate the current translation app using an appropriate Azure service. (Functions for example)

Acceptance Criteria

  1. Automatically scalable to serve a large number of requests
  2. Feature Rate-limiting to prevent over-loading of the service
  3. Quick response time
  4. Input Validation and Error-handling
  5. Authentication (Optional for now)

You will need to request for access to the current github repository to start working on this. Please contact me.

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.