GenderPrediction.Turkish 1.0.0

Turkish Names Gender Prediction

GenderPrediction.Turkish is a library that provides prediction of gender from Turkish names built on ML.NET Both training

Install-Package GenderPrediction.Turkish -Version 1.0.0
dotnet add package GenderPrediction.Turkish --version 1.0.0
<PackageReference Include="GenderPrediction.Turkish" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GenderPrediction.Turkish --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Turkish Names Gender Prediction

GenderPrediction.Turkish is a library that provides a prediction of gender from Turkish names built on ML.NET
Both training application and library included in source code.

Usage

GenderPrediction.Turkish can be used with any DI library, or it can be used standalone.

Standalone Initialization

If you do not want to use any DI framework, you have to instantiate GenderPredictionStandalone as follows.

IGenderPredictionService genderPredictionService = GenderPredictionStandalone.Create();

Microsoft.Extensions.DependencyInjection Initialization

First, you need to install Microsoft.Extensions.DependencyInjection NuGet package as follows

dotnet add package Microsoft.Extensions.DependencyInjection

Register necessary dependencies to ServiceCollection as follows

var services = new ServiceCollection();
services.AddSingleton<IGenderPredictionEngine, GenderPredictionEngine>();
services.AddTransient<IGenderPredictionService, GenderPredictionService>();

ServiceProvider buildServiceProvider = services.BuildServiceProvider();

var genderPredictionService = buildServiceProvider.GetRequiredService<IGenderPredictionService>();

After the library is initialized, it is very easy to use

GenderPredictionModel model = genderPredictionService.Predict("Deniz");

string name = genderPredictionModel.Name;
Gender predictedGender = genderPredictionModel.PredictedGender;
float maleProbability = genderPredictionModel.Score[Gender.Male];
float femaleProbability = genderPredictionModel.Score[Gender.Female];
float unisexProbability = genderPredictionModel.UnisexProbability

Or

string[] names = new[] {"Dilek", "Hasan", "Mehmet", "İbrahim"};
IEnumerable<GenderPredictionModel> model = genderPredictionService.Predict(names);

Turkish Names Gender Prediction

GenderPrediction.Turkish is a library that provides a prediction of gender from Turkish names built on ML.NET
Both training application and library included in source code.

Usage

GenderPrediction.Turkish can be used with any DI library, or it can be used standalone.

Standalone Initialization

If you do not want to use any DI framework, you have to instantiate GenderPredictionStandalone as follows.

IGenderPredictionService genderPredictionService = GenderPredictionStandalone.Create();

Microsoft.Extensions.DependencyInjection Initialization

First, you need to install Microsoft.Extensions.DependencyInjection NuGet package as follows

dotnet add package Microsoft.Extensions.DependencyInjection

Register necessary dependencies to ServiceCollection as follows

var services = new ServiceCollection();
services.AddSingleton<IGenderPredictionEngine, GenderPredictionEngine>();
services.AddTransient<IGenderPredictionService, GenderPredictionService>();

ServiceProvider buildServiceProvider = services.BuildServiceProvider();

var genderPredictionService = buildServiceProvider.GetRequiredService<IGenderPredictionService>();

After the library is initialized, it is very easy to use

GenderPredictionModel model = genderPredictionService.Predict("Deniz");

string name = genderPredictionModel.Name;
Gender predictedGender = genderPredictionModel.PredictedGender;
float maleProbability = genderPredictionModel.Score[Gender.Male];
float femaleProbability = genderPredictionModel.Score[Gender.Female];
float unisexProbability = genderPredictionModel.UnisexProbability

Or

string[] names = new[] {"Dilek", "Hasan", "Mehmet", "İbrahim"};
IEnumerable<GenderPredictionModel> model = genderPredictionService.Predict(names);

Version History

Version Downloads Last updated
1.0.0 75 1/25/2019