Coder Social home page Coder Social logo

vincenthuang75025 / chinglish Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 131 KB

Chrome extension for translating highlighted English text into Chinglish (a chinese + english hybrid)

Python 96.26% Dockerfile 1.05% JavaScript 1.92% HTML 0.76%
aws-lambda chrome-extension code-switching nlp serverless translation

chinglish's Introduction

Chinglish Chrome Extension

This is a fun project I worked on to get more experience with NLP, serverless computing, and chrome extension development. It takes selected text in the browser and translates the text into Chinglish (a Chinese-English hybrid):

chinglish4.mp4

How It Works

The translation code in the chinglish-api directory is hosted on AWS Lambda, with a public endpoint set up on Amazon API Gateway. The README in that directory has details on how to set it up.

The current version of the translation algorithm (inspired by conversations with CJ Quines and Franklyn Wang) works as follows:

  • Take the selected text and translate it entirely into Chinese
  • Run the Chinese text through a word segmentation process (we use the jiagu library)
  • Check if each of the segmented phrases is in a Chinese primary school vocabulary list. If so, it is considered "easy". Otherwise, it is considered "hard"
  • Translate the hard phrases back into English

This translation quality could be greatly improved (especially the last step outlined above, which often introduces errors because fragments are taken out of context), but I currently don't have the resources to train a new bilingual model. Let me know if you have suggestions for other approaches to translation improvement!

How To Use It

Unfortunately, I had to shut down my AWS code to avoid exceeding the free tier limits. To use this or do further testing and development, you will have to deploy your own serverless function (instructions in chinglish-api) and paste your API url into line 7 of frontend-extension/selection.js. You can also run everything locally if you have a fast computer.

To actually perform a translation, select some text on a webpage. Open the extension menu (either by clicking it or with the shortcut Ctrl+Shift+F), select the appropriate Chinese difficulty level you want (the options range from Chinese grade 1 to grade 6), and submit the translate button.

chinglish's People

Contributors

vincenthuang75025 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

chinglish's Issues

Demo Video

Uploading video for readme

chinglish4.mp4

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.