I’ve been working on an application which has an Alexa/Siri like feature. There are a few commands in my application like “Play music”, “Take a picture”, “Search on the internet” etc. Now, I’ve integrated the speech to text API which gives me the input in the form of text, but I don’t understand how to match it with the predefined commands in my app to determine which command should be executed.
I’ve read that Hamming distance and Levenshtein distance work well for string matching, but I was wondering if someone could explain it to me using code samples.
Also, can I somehow use TF-IDF vectors for this task?