Git Product home page Git Product logo

bedrock-translate's Introduction

Bedrock Translate

npm version PRs Welcome install size

This project is created for translating markdown files, I only tested for translating AWS workshops. More features will be added soon. Feel free to send a feature request here.

๐Ÿ”ฅ Roadmap

  • Support translating file name with different name pattern
  • Support using different LLM models
  • Support translating PPTX files
  • Let llm read an article before translating for improving translation accuracy
  • Fine tune the translation using few shot learning prompt
  • Add support for

๐Ÿ‘‹ Getting Started

Prerequisites

  • Node 20: Install Node.js 20 Download Node.js
  • AWS credential: Install the AWS CLI, set up the AWS CLI, enable the Anthropic Haiku & Sonnet models from the AWS console and attach an IAM policy to invoke these Amazon Bedrock models (bedrock:InvokeModelWithResponseStream).

How to install

npm install -g br-translate

๐Ÿง‘โ€๐Ÿ’ป How to use

Languages supported

"en": "english",
"es": "spanish",
"ja": "japanese",
"fr": "french",
"ko": "korean",
"pt": "portuguese",
"de": "german",
"it": "italian",
"zh": "chinese (simplified)",
"zh-TW": "chinese (traditional)",
"uk": "ukrainian",
"pl": "polish",
"id": "indonesian",
"nl": "dutch",
"ar": "arabic"

Translate Single File

// Simplified Chinese
br-translate start --file content/sms-v2-components/all-together/index.en.md  \
                            --targetLanguageCode zh

// Spanish
br-translate start --file content/sms-v2-components/all-together/index.en.md \
                            --targetLanguageCode es

Translate Entire Directory

// Spanish
br-translate start --dir ./content/clean-up --targetLanguageCode es
     
// Simplified Chinese
br-translate start --dir ./content --targetLanguageCode zh 

๐Ÿ”ง Fine Tuning

If you would like to improve the translation, this package also flexible to add extra prompt and few shot learning. You may follow this guide for more details.

โš™๏ธ Options

Options:
  -d, --dir <directory>                            Directory containing files to translate
  -f, --file <filePath>                            single file translation
  -tlc, --targetLanguageCode <targetLanguageCode>  Target language you need
  -p, --promptFilePath <promptFilePath>            [Optional] Extra prompt for translation
  -r, --referenceFilePath <referenceFilePath>      [Optional] Sample translations you want the LLM to read before translation
  -slc, --sourceLanguageCode <sourceLanguageCode>  [Optional] The language you choose to translate from
  -h, --help   

๐Ÿค Contributors

Alick Wong
Pavlos Ioannou Katidis
Rex Law

bedrock-translate's People

Contributors

alickwong avatar

Watchers

 avatar

Forkers

pavlosik

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.