I would like to build an NLP classification model. My input is a paragraph or a sentence. Ideally, my output is a score or probability (between 0 and 1).
I have defined specific entities ex-ante, each entity belongs to a single group.
Based on business insights, we know that the output to predict does not depend on the entities by themselves, but depends on their groups. For example, the phrase “Max barks” would return 1 because “Max” belongs to the group “Dogs”, but “Kitty barks” would return 0 (because Kitty is not a dog). If “Max” was a cat, the phrase would return 0. One way to do so would be to generate all the sentences with all the permutations of dogs and cats (in my example) but that is very cumbersome! Another way would be to replace the entity with the name of the group (the phrase “Max” becomes “” for example) but that looks weird to me!
I don't have any other idea how to tackle this problem.
Could you please help me, ideally with code?
Thanks a lot.