Skip to content

Intent Classification Pipeline

Oceania edited this page Aug 10, 2018 · 3 revisions

Add An Intent Classification Pipeline

Plug in a new intent classifier is as easy as just follow below steps:

1. Add a classifier class

Add a new class named FooClassifier in the Classifiers folder.

public class FooClassifier
{
}

2. Implement the interface

Implement the NLP pipline interface named INlpPipeline.

public class FooClassifier : INlpPipeline
{
    public IConfiguration Configuration { get; set; }

    public Task<bool> Predict(Agent agent, JObject data, PipeModel meta)
    {
        throw new NotImplementedException();
    }

    public Task<bool> Train(Agent agent, JObject data, PipeModel meta)
    {
        throw new NotImplementedException();
    }
}

3. Config the pipe

Modify the bot.json under the Settings folder, located at your BotPlatform section, add FooClassifier in the Pipe.

"BotSharpAi": {
    "Pipe": "BarTokenizer, ZooEntityRecognizer, FooClassifer"
}

Well done. You've wrote a new intent classifier.