dotnet / dotnet/machinelearning-modelbuilder
Named Entity Recognition: Generated code to retrain is not working
- Lingua principale
- Dockerfile
- Stelle
- 285
- Fork
- 66
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**System Information (please complete the following information):**
- Model Builder Version (available in Manage Extensions dialog): 17.18.2.2415501
- Visual Studio Version: 17.9.2
Train function generated by Builder is not working for "Named Entity Recognition" and cause exception:
> System.ArgumentOutOfRangeException: 'Cannot map column (name: Label, type: Key) in data to the user-defined type, Microsoft.ML.Data.VBuffer`1[System.UInt32]. Arg_ParamName_Name'
Using builder, a was able to generate Named Entity Recognition mlnet model. Builder generated *.training.cs file with "Train" function:
```
///
/// Train a new model with the provided dataset.
///
/// File path for saving the model. Should be similar to "C:\YourPath\ModelName.mlnet"
/// Path to the data file for training.
/// Separator character for delimited training file.
/// Boolean if training file has a header.
public static void Train(string outputModelPath, string inputDataFilePath = RetrainFilePath, char separatorChar = RetrainSeparatorChar, bool hasHeader = RetrainHasHeader, bool allowQuoting = RetrainAllowQuoting)
{
var mlContext = new MLContext();
var data = LoadIDataViewFromFile(mlContext, inputDataFilePath, separatorChar, hasHeader, true);
var model = RetrainModel(mlContext, data);
SaveModel(mlContext, model, data, outputModelPath);
}
```
Trying to use this function cause an exception on:
```
///
/// Retrain model using the pipeline generated as part of the training process.
///
///
///
///
public static ITransformer RetrainModel(MLContext mlContext, IDataView trainData)
{
var pipeline = BuildPipeline(mlContext);
var model = pipeline.Fit(trainData); // <-HERE AN EXCEPTION IS THROWN
return model;
}
```
> System.ArgumentOutOfRangeException: 'Cannot map column (name: Label, type: Key) in data to the user-defined type, Microsoft.ML.Data.VBuffer`1[System.UInt32]. Arg_ParamName_Name'
Here is the example dataset i made for the sake of this post but every data set i have tried is not working:
[test data example.txt](https://github.com/dotnet/machinelearning-modelbuilder/files/14549394/test.data.example.txt)
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia con il file generato *.training.cs e riproduci il fallimento in RetrainModel in pipeline.Fit(trainData) usando l’esempio di dati di test allegato example.txt. Segui la colonna Label attraverso LoadIDataViewFromFile e BuildPipeline, quindi verifica che l’addestramento venga completato senza l’eccezione di mapping segnalata e che il modello generato possa essere salvato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- machine-learning
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100