Git Product home page Git Product logo

english_to_hinglish's Introduction

English to Hinglish Translator

This repository contains a Python code script (Jupyter Notebook) that translates English sentences to Hinglish. It utilizes the Hugging Face Transformers library for machine translation. The code also processes nouns and verbs within the input sentences.

Requirements

  • Python 3.6+
  • Jupyter Notebook
  • Transformers library (pip install transformers)
  • NLTK library (pip install nltk)
  • SentencePiece library (pip install sentencepiece)

Installation

  1. Clone the repository to your local machine.
git clone https://github.com/sandip-2002/English_to_Hinglish.git
cd English_to_Hinglish
  1. Create a virtual environment and install the required packages:
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txt
  1. Start a Jupyter Notebook server:
jupyter notebook

Usage

1.Running the Model

2.Open the Jupyter Notebook file English_to_Hinglish_Translator.ipynb.

3.Ensure you have Jupyter Notebook installed, and the required Python packages are installed in your virtual environment.

  1. Run the code cells in the Jupyter Notebook to translate English sentences to Hinglish.

4.The output translations will be displayed within the notebook, and the Hinglish translations will be generated and printed.

Evaluating Model Performance

  1. Collect reference translations for the sentences to be evaluated.
  2. Generate candidate translations using your machine translation model.
  3. For each sentence: a. Tokenize the reference and candidate translations. b. Calculate the BLEU score for the candidate translation compared to the reference translations. c. Use a smoothing function to handle discrepancies in n-gram counts.
  4. Calculate the average BLEU score across all sentences.
  5. Interpret the BLEU scores: Higher scores indicate better translation quality.
  6. Use BLEU scores to assess and potentially improve your machine translation model.

Output

The output translations for the provided example sentences are saved in the output.txt file.

Examples

Here are some example sentences that you can translate:

"Definitely share your feedback in the comment section." "So even if it's a big video, I will clearly mention all the products." "I was waiting for my bag."

Credits

This code uses the Hugging Face Transformers library for machine translation.

english_to_hinglish's People

Contributors

sandip-2002 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.