Subject
Hello. I wanna implement text classification feature using Tensorflow.js in NodeJS
.
Its job will be to match a string with some pre-defined topics.
Examples:
Input: String
: "My dog loves walking on the beach"
Pre-defined topcics: Array<String>
: ["dog", "cat", "cow"]
Output: There are many output variants I am comfortable with. These are some examples, but if you can suggest better, Do it!
String
(the most likely topic) - Example: "dog"Object
(every topic with a predicted score)
Example:{"dog": 0.9, "cat": 0.08, "cow": 0.02}
Research
I know similar results can be achieved by filtering the strings for the topic names and doing some algorithms but also can be achieved with ML.
There were already some posts about using strings, classifying text and creating autocomplete with TensorFlow (but not sure about TFjs
), like these:
- https://www.tensorflow.org/hub/tutorials/text_classification_with_tf_hub
- http://ruder.io/text-classification-tensorflow-estimators/
- https://machinelearnings.co/tensorflow-text-classification-615198df9231
How you can help
My goal is to do the topic prediction with TensorflowJS
. I need just an example of the best way to train models with strings or how to classify text and then will extend the rest by myself.