Closed ZanSara closed 2 years ago
@ZanSara just one question to better understand your opinion...
Should we make TransformersQueryClassifier
more general and suitable for handling non-binary output labels?
Hey @anakin87! Yes that's the aim. Right now the node is highly tailored for the specific model I mentioned above, so even other binary models would not work. First of all, I think any binary model should work as a QueryClassifier, but honestly I think it's worth to take this occasion to really improve it. if it was able to handle a generic text classification model it would be really cool :blush:
By the way: feel free to go for a heavy rewrite if you believe it's a good call. Just make sure that is still compatible with the tutorial.
Problem Currently
TransformersQueryClassifier
is very closely build around the question/keywords/statement classifier model used in the tutorials ("hahrukhx01/bert-mini-finetune-question-detection). In practice, it can only handle models that output binary labels, one of which must be calledLABEL_1
.I believe this limitations make it unsuitable for any other model than the one used in the example.
Solution HuggingFace how hosts a wide array of zero-shot text classification models which could be nicely applied to query classification, for example for sentiment/emotion analysis, or for topic classification. With limited changes,
TransformersQueryClassifier
can be improved to use these models effectively.Note Currently it's possible to write custom nodes for this usecase. Here is an example.