Panlingo.LanguageIdentification.MediaPipe 0.0.0.20

There is a newer version of this package available.
See the version list below for details.
dotnet add package Panlingo.LanguageIdentification.MediaPipe --version 0.0.0.20                
NuGet\Install-Package Panlingo.LanguageIdentification.MediaPipe -Version 0.0.0.20                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Panlingo.LanguageIdentification.MediaPipe" Version="0.0.0.20" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Panlingo.LanguageIdentification.MediaPipe --version 0.0.0.20                
#r "nuget: Panlingo.LanguageIdentification.MediaPipe, 0.0.0.20"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Panlingo.LanguageIdentification.MediaPipe as a Cake Addin
#addin nuget:?package=Panlingo.LanguageIdentification.MediaPipe&version=0.0.0.20

// Install Panlingo.LanguageIdentification.MediaPipe as a Cake Tool
#tool nuget:?package=Panlingo.LanguageIdentification.MediaPipe&version=0.0.0.20                

Panlingo.LanguageIdentification.MediaPipe

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

  • Runtime: .NET >= 5.0
  • OS: Linux
  • Arch: AMD64

Installation

To integrate the MediaPipe functionality, follow these steps:

  1. Install the NuGet package:

    dotnet add package Panlingo.LanguageIdentification.MediaPipe
    
  2. Download the Pretrained Models:

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

    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:

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.
using Panlingo.LanguageIdentification.MediaPipe;

class Program
{
    static void Main()
    {
        var modelPath = "/models/mediapipe_language_detector.tflite";
        using var mediaPipe = new MediaPipeDetector(resultCount: 10, modelPath: modelPath);

        var text = "Привіт, як справи?";

        var predictions = mediaPipe.PredictLanguages(text);

        foreach (var prediction in predictions)
        {
            Console.WriteLine(
                $"Language: {prediction.Language}, " +
                $"Probability: {prediction.Probability}"
            );
        }
    }
}

Sources

  1. Original MediaPipe Repository
  2. Language detection guide
  3. Language detector (model card)
  4. Language identification at Wikipedia

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! 👩‍💻👨‍💻


Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.0 93 11/10/2024
0.1.1 208 10/22/2024
0.0.0.23 103 10/7/2024
0.0.0.22 354 9/22/2024
0.0.0.21 123 9/10/2024
0.0.0.20 103 9/8/2024
0.0.0.19 131 9/1/2024
0.0.0.18 95 8/26/2024
0.0.0.17 122 8/21/2024
0.0.0.16 133 8/9/2024

- Initial release