polyglotr

R package to translate text

https://github.com/tomeriko96/polyglotr

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.0%) to scientific vocabulary

Keywords

cran cran-r google-translate googletranslate language linguee mymemory-api mymemorytranslator package pons r rpackage rstats translation translations-api
Last synced: 6 months ago · JSON representation

Repository

R package to translate text

Basic Info
Statistics
  • Stars: 38
  • Watchers: 2
  • Forks: 4
  • Open Issues: 8
  • Releases: 4
Topics
cran cran-r google-translate googletranslate language linguee mymemory-api mymemorytranslator package pons r rpackage rstats translation translations-api
Created over 3 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License

README.md

polyglotr

polyglotr | Multilingual Text Translation

Versatile R Package for Text Translation
Seamless integration with multiple free translation services for R users.
Ideal for translating text, files, and creating multilingual datasets.

CRAN | Features | Installation | Usage | Contribution

Built by Tomeriko96 and contributors.

Codecov test coverage R-CMD-check CRAN status CRAN last month downloads CRAN downloads The diffify page for the R package polyglotr Shiny App Deployed

Table of Contents

Overview

The polyglotr package is a language translation tool for the R programming language. It provides convenient functions to translate text using different (free) translation services. This vignette will guide you through the usage of the package and demonstrate how to translate text and files in various languages.

Currently, the package has functions to communicate with the following services:

Why polyglotr?

polyglotr stands out as a versatile and user-friendly translation tool for R users. Here's why you should consider using it:

  1. No Authentication Hassle

    • Access multiple translation services without API keys or complex authentication.
    • Start translating immediately after installation, with no sign-ups or accounts.
  2. Multiple Services, One Package

    • Use various translation services (Google, Mymemory, Linguee, Pons, QCRI, Wikimedia) through a single interface.
    • Easily switch between services to compare translations or find the best fit.
  3. R-Native Solution

    • Integrate translation capabilities into your R workflows and data analysis pipelines.
    • Benefit from R's data manipulation strengths while translating.
  4. Flexibility and Scalability

    • Translate single phrases, large datasets, or entire files with equal ease.
    • Create multilingual datasets using built-in functions.
  5. Open Source and Community-Driven

    • Continuous improvements and updates driven by user feedback and contributions.
    • Adapt the package to your needs by accessing and modifying the source code.
  6. Comprehensive Documentation

    • Get started quickly with extensive documentation, vignettes, and examples.
    • Access a wide range of use cases and best practices.

By choosing polyglotr, you're opting for a powerful, flexible, and user-friendly translation solution that integrates seamlessly with your R environment, all without the barriers of authentication or service-specific setups.

Features

  • Translate text using multiple free translation services
  • Batch translation capabilities
  • Language detection
  • Create translation tables for multiple languages
  • File translation
  • Easy-to-use interface for different translation APIs
  • NEW: Interactive Shiny web application for non-R users

To see which functions are available, please refer to the reference page of the polyglotr package. The reference page provides a comprehensive list of functions available in the package, organized by category.

Additionally, the package includes vignettes that provide more detailed information on how to use the functions in the package.

Installation

To install the package:

```{r}

The easiest way is to get polyglotr from CRAN

install.packages("polyglotr")

Alternatively, install the development version from GitHub

install.packages("remotes")

remotes::install_github("Tomeriko96/polyglotr") ```

Quick Start

Here's a minimal example to get you started:

``` library(polyglotr)

Translate a simple phrase using Google Translate

text <- "Hello, world!" translation <- googletranslate(text, targetlanguage = "fr") print(translation)

Translate using Apertium (no API key required)

translationapertium <- apertiumtranslate(text, targetlanguage = "es", sourcelanguage = "en") print(translation_apertium)

```

Shiny Web App

Shiny App Deployed

polyglotr includes a web application for translation services, accessible to users without R programming knowledge.

Launching the App

```r library(polyglotr) launchpolyglotrapp()

Or with custom settings

launchpolyglotrapp(port = 3838, launch.browser = TRUE) ```

App Features

  • Multiple translation services: Google Translate, MyMemory, PONS, Linguee, QCRI, Apertium, Wikimedia Cloud
  • Language detection
  • Dynamic language selection based on service
  • User-friendly dashboard interface
  • No coding required

Installation Requirements

To use the Shiny app, install these additional packages:

r install.packages(c("shiny", "shinydashboard", "DT"))

Usage

To demonstrate the usage of the polyglotr package, let's consider an example where we translate a list of texts into multiple languages using the create_translation_table function.

```{r} texts <- c("Hello, how are you?", "I love programming!", "This is a test.")

languages <- c("es", "fr", "de")

createtranslationtable(texts, languages)

> Original_word es

> 1 Hello, how are you? ¿Hola, cómo estás?

> 2 I love programming! ¡Me encanta programar!

> 3 This is a test. Esto es una prueba.

> fr de

> 1 Bonjour comment allez-vous? Hallo, wie geht's dir?

> 2 J'adore programmer ! Ich liebe Programmieren!

> 3 C'est un test. Das ist ein Test.

```

Documentation

Contribution

Contributions are welcome! If you'd like to contribute, please:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use polyglotr in your research, please cite it as follows:

Iwan, T. (2023). polyglotr: Multilingual Text Translation in R. R package version 1.0.0. https://github.com/Tomeriko96/polyglotr

Related Projects

  • googleLanguageR: R client for the Google Translation API, Cloud Natural Language API, Cloud Speech API, and Cloud Text-to-Speech API

Owner

  • Login: Tomeriko96
  • Kind: user

GitHub Events

Total
  • Issues event: 8
  • Watch event: 8
  • Delete event: 2
  • Issue comment event: 13
  • Push event: 42
  • Pull request review event: 9
  • Pull request review comment event: 4
  • Pull request event: 8
  • Create event: 2
Last Year
  • Issues event: 8
  • Watch event: 8
  • Delete event: 2
  • Issue comment event: 13
  • Push event: 42
  • Pull request review event: 9
  • Pull request review comment event: 4
  • Pull request event: 8
  • Create event: 2

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 69
  • Total Committers: 3
  • Avg Commits per committer: 23.0
  • Development Distribution Score (DDS): 0.522
Past Year
  • Commits: 56
  • Committers: 3
  • Avg Commits per committer: 18.667
  • Development Distribution Score (DDS): 0.536
Top Committers
Name Email Commits
Tomer Iwan i****r@h****m 33
Tomer Iwan t****n@v****l 25
Tomeriko96 I****r@h****m 11
Committer Domains (Top 20 + Academic)
vu.nl: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 16
  • Total pull requests: 6
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 21 hours
  • Total issue authors: 10
  • Total pull request authors: 3
  • Average comments per issue: 2.06
  • Average comments per pull request: 0.5
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 6
  • Pull requests: 6
  • Average time to close issues: 16 days
  • Average time to close pull requests: about 21 hours
  • Issue authors: 5
  • Pull request authors: 3
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.5
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Tomeriko96 (6)
  • tin900 (2)
  • tjbrailey (1)
  • gc5011 (1)
  • langeannika38-maker (1)
  • lbajemon (1)
  • larry77 (1)
  • lvaudor (1)
  • EPdeJ (1)
  • aslamht (1)
Pull Request Authors
  • Copilot (3)
  • aslamht (2)
  • tin900 (1)
Top Labels
Issue Labels
enhancement (4) bug (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 384 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 14
  • Total maintainers: 1
cran.r-project.org: polyglotr

Translate Text

  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 384 Last month
Rankings
Stargazers count: 15.8%
Forks count: 21.0%
Dependent repos count: 23.8%
Average: 23.8%
Dependent packages count: 28.7%
Downloads: 29.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • httr * imports
  • magrittr * imports
  • rvest * imports
  • stringr * imports
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 3.0.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/r-pkg-validation.yml actions
  • actions/checkout v3 composite
  • insightsengineering/thevalidatoR main composite
  • svenstaro/upload-release-action v2 composite