Skip to content

deepaksirohiwal/Deep_learning_language_translation_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Language Translation API Documentation

This documentation describes how to use the Language Translation API, which provides translation capabilities for multiple languages.

API Description

The Language Translation API is built using Python's FAST-API framework and provides the following capabilities:

  • Translation from one language to another, with support for multiple languages

Running the API Locally

To run the Language Translation API locally, follow the steps below:

  • Clone the repository from Github: git clone https://github.com/deepaksirohiwal/Deep_learning_language_translation_API.git
  • Install the required dependencies by running pip install -r requirements.txt
  • Run the API using Uvicorn by running uvicorn main:app --reload
  • The API will now be available at http://localhost:8000/

Docker Image

To run the Langauge Translation API locally using Docker image, follow the steps below:

  • Build the docker image docker buildx build --platform linux/amd64 -t dlapi .
  • Runt the API inside the docker container docker run -d --name dlapi -p 80:80 dlapi
  • The API will now be available at http://localhost:80

API Usage

To use the Language Translation API, send a POST request to the endpoint /translate and a task_id will be return. The request body should be in JSON format and contain the following parameters:

  • text : The text to be translated.
  • base_lang: The source language of the text (e.g., English).
  • final_language: The target language for the translation (e.g., French). Use the returned task_id to send a GET request to the endpoint /results

Here's an example request:

Animation

The API will respond with a JSON object containing the translated text:

request_responsejpg

Supported Languages and Models

The Language Translation API supports multiple languages and trained on t5-small model. This model can be replaced by more powerfull t5-base and t5-large. Here's a list of currently supported languages and their corresponding language codes:

  • English
  • French
  • German
  • Romanian

Conclusion

That's it! You now know how to run and use the Language Translation API. If you have any questions or feedback, please feel free to contact me.

Releases

No releases published

Packages

No packages published