Allow multiple classifications.
This commit is contained in:
parent
5c3d3fea64
commit
378bd43f09
|
|
@ -45,7 +45,7 @@ namespace BotSharp.NLP.UnitTest
|
|||
testData.ForEach(td =>
|
||||
{
|
||||
var classes = classifier.Classify(td);
|
||||
if(td.Label == classes[0].Item1)
|
||||
if(td.Labels[0] == classes[0].Item1)
|
||||
{
|
||||
correct++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace BotSharp.NLP.Classify
|
|||
{
|
||||
_classifier.Train(sentences.Select(x => new LabeledFeatureSet
|
||||
{
|
||||
Label = x.Label,
|
||||
Label = x.Labels[0],
|
||||
Features = GetFeatures(x.Words)
|
||||
}).ToList(), _options);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace BotSharp.NLP.Corpus
|
|||
{
|
||||
sentences.Add(new Sentence
|
||||
{
|
||||
Label = lable,
|
||||
Labels = new List<string> { lable },
|
||||
Text = line
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ namespace BotSharp.NLP
|
|||
{
|
||||
public List<Token> Words { get; set; }
|
||||
|
||||
public String Label { get; set; }
|
||||
/// <summary>
|
||||
/// Allow multiple classification
|
||||
/// </summary>
|
||||
public List<String> Labels { get; set; }
|
||||
|
||||
public String Text { get; set; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue