Move label to model dir

This commit is contained in:
Wenbo Cao 2023-09-01 09:56:24 -05:00
parent fc96c36dc0
commit 5e46af7ba2
4 changed files with 8 additions and 1 deletions

View file

@ -196,7 +196,10 @@ public class IntentClassifier
public string[] GetLabels()
{
return GetFiles().Select(x => Path.GetFileNameWithoutExtension(x)).ToArray();
var agentService = _services.CreateScope().ServiceProvider.GetRequiredService<IAgentService>();
string rootDirectory = Path.Combine(agentService.GetDataDir(), _settings.RAW_DATA_DIR, _settings.LABEL_FILE_NAME);
var labelText = File.ReadAllLines(rootDirectory);
return labelText.OrderBy(x => x).ToArray();
}
public string TextClean(string text)

View file

@ -15,4 +15,5 @@ public class ClassifierSetting
public string RAW_DATA_DIR { get; set; } = "raw_data";
public string MODEL_DIR { get; set; } = "models";
public string LABEL_FILE_NAME { get; set; } = "label.txt";
}

Binary file not shown.

View file

@ -0,0 +1,3 @@
goodbye
greeting
other