Skip to content

Commit

Permalink
Docs for MediaPipe
Browse files Browse the repository at this point in the history
  • Loading branch information
gluschenko committed Aug 30, 2024
1 parent 8c806d8 commit 6c990dd
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README_LANGUAGE_CODE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Panlingo.LanguageCode is a comprehensive .NET library designed for managing and
## What are Language Codes?

Language codes are standardized codes used to identify languages. The ISO 639 standard defines sets of codes for the representation of names of languages. There are several parts to the ISO 639 standard:
- **ISO 639-1**: Defines two-letter codes (e.g., "en" for English, "ru" for Russian).
- **ISO 639-2**: Defines three-letter codes (e.g., "eng" for English, "rus" for Russian).
- **ISO 639-3**: Extends the code set to cover all known languages.
- **ISO 639-1**: Defines two-letter codes (e.g., "en" for English, "uz" for Uzbek);
- **ISO 639-2**: Defines three-letter codes (e.g., "eng" for English, "uzb" for Uzbek);
- **ISO 639-3**: Extends the code set to cover all known languages (e.g., "en" for English, "ru" for Russian).

These codes are essential in various applications, including software localization, data exchange between systems, and linguistic research.

Expand Down
5 changes: 5 additions & 0 deletions README_LINGUA.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ class Program
| Yoruba | yor | `LinguaLanguage.Yoruba` |
| Zulu | zul | `LinguaLanguage.Zulu` |

## Alternatives

If you are exploring other options, here are some alternatives to consider:

- **[searchpioneer/lingua-dotnet](https://github.com/searchpioneer/lingua-dotnet)**: An alternative port for .NET.

---

Expand Down
69 changes: 68 additions & 1 deletion README_MEDIAPIPE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
# Panlingo.LanguageIdentification.MediaPipe

TBD
Welcome to **Panlingo.LanguageIdentification.MediaPipe**, a .NET wrapper for the MediaPipe library by Google Inc. This package seamlessly integrates language identification capabilities into .NET applications, enabling accurate and efficient recognition of over 107 languages with minimal effort. Perfect for applications dealing with multilingual texts or requiring automatic language detection.

## Requirements

- .NET >= 5.0
- Linux

## Installation

To integrate the MediaPipe functionality, follow these steps:

1. **Install the NuGet package**:

```sh
dotnet add package Panlingo.LanguageIdentification.MediaPipe
```

2. **Download the Pretrained Models**:

Download the pretrained language identification (LID) model provided by Google:

```sh
curl --location -o /models/mediapipe_language_detector.tflite https://storage.googleapis.com/mediapipe-models/language_detector/language_detector/float32/1/language_detector.tflite
```

Learn more about this model here:
- [Google AI Edge](https://ai.google.dev/edge/mediapipe/solutions/text/language_detector)

## Usage

Integrating the MediaPipe library into your .NET application is straightforward. Here’s a quick guide to get you started:

1. **Install the Package**: Ensure you have added the `Panlingo.LanguageIdentification.MediaPipe` package to your project using the provided installation command.
2. **Download the Models**: Follow the provided commands to download the pretrained language identification models.
3. **Initialize the Library**: Follow the example snippet to initialize and use the MediaPipe library for detecting languages.

```csharp
using Panlingo.LanguageIdentification.MediaPipe;
class Program
{
static void Main()
{
using var mediaPipe = new MediaPipeDetector(resultCount: 10);
var text = "Привіт, як справи?";
var predictions = mediaPipe.PredictLanguages(text);
foreach (var prediction in predictions)
{
Console.WriteLine(
$"Language: {prediction.Language}, " +
$"Probability: {prediction.Probability}"
);
}
}
}
```

---

We value your feedback. Feel free to open issues or contribute to the repository. Let’s make language detection in .NET even more powerful and versatile! 🌍📝

Happy coding! 👩‍💻👨‍💻

---

0 comments on commit 6c990dd

Please sign in to comment.