Demonstration of integrating the ML.Net Text Classification into Azure IoT Edge.
This example is part of a blog at https://blog.vandeveldne-online.com
This project contains two modules:
- iot-edge-mlnet-text-classification
- iot-edge-mlnet-text-classification-test
The first module takes a message on input 'input1' and write the outcome to output 'output1'. The outcome is also shown in the console log.
The second module is there to test the text classification. It supports a method for sending multiple test comments.
Input message format:
public class Request
{
public string comment {get; set;}
}
Output message format:
public class Response
{
public string comment {get; set;}
public string prediction {get; set;}
public Score[] scores {get; set;}
}
public class Score
{
public float entry {get; set;}
}
Direct method 'meassureSentiment' body format:
public class Request
{
public string comment {get; set;}
}
Output message format:
public class Response
{
public string comment {get; set;}
}
The two modules are conencted with a route:
FROM /messages/modules/test/outputs/output1 INTO BrokeredEndpoint("/modules/text/inputs/input1")
This results in:
The modules are available from Docker hub directly:
svelde/iot-edge-mlnet-text-classification-test:1.0.0
https://hub.docker.com/repository/docker/svelde/iot-edge-mlnet-text-classification-test
and
svelde/iot-edge-mlnet-text-classification:1.0.0
https://hub.docker.com/repository/docker/svelde/iot-edge-mlnet-text-classification
This project is open source and availabe under MIT license.
Feel free to contribite to this project.
Or buy us a beer if it realy helped you :-)