I'm playing around with the
TextBlob library for python. It has in it a
NaiveBayesClassifier as well as a
DecisionTreeClassifier. However, they do not work for my purposes. I need to be able to look at differences between strings, preferably in form that lends itself to template-like substitution of the different parts.
So for example, suppose we train with: $$ \psi : \\ aAb \mapsto 0, \\ a b \mapsto 1, $$ Then it should automatically recognize, either, the absence of the $A$, or the presence of something else besides the $A$:
$$ \psi(ac) = 1 \\ $$
for example, is possible immediately after the two samples. Maybe there should be settings to choose what / how the differences are made.
I'd also like it to be able to create "substitution templates" between the input and output of a mapping. So if $aAb \mapsto cAd$ is a mapping, then it knows when it sees $aBb$ to map it to $cBd$. I think there should be some interesting math involved in this problem, intuitively.
Take a look at this image:
In the language of category theory, it commutes. But it has two mappings from $aAb$ so I don't know how we'd handle that in terms of classification.
$a, b, c, A,B,C,D$ are all strings, the capital letters were just for convenience.