Entrance task #1916: factor graph model for multi-label classification example

This is for entrance task #1916.
I have closed the previous PR #2018 and included the comments in a single commit in this version.