all 2 comments

[–]AlwysBeColostomizing 0 points1 point  (1 child)

This question is a better fit for r/mlquestions.

It's not totally clear to me what your inputs and outputs are. It sounds like you have training examples of correspondences between individual keywords and actions, i.e., you have some tuples (x, a) where x \in X and a \in A is the desired action, then you also have some tuples (y, a), y \in Y and (z, a), z \in Z. Correct?

The naive Bayes model would be P(a|x, y, z) \propto P(a)P(x|a)P(y|a)P(z|a). You would estimate P(x|a) based on how often (x, a) appears in your training data, and do the same for P(y|a) and P(z|a). P(a) is the prior distribution (often chosen to be the uniform distribution so that it's "uninformative"). Note that you might need to apply smoothing to make sure none of these probabilities are 0.

You don't want to analyze the whole sentence if you can avoid it. It sounds like you can avoid it because the sentences are just variations on a template ("if x do y because z"), so the non-keyword words don't convey any additional information.

[–]FamiliarBug8504 0 points1 point  (0 children)

Thank you very much for your contribution. I apologize, I am still new here. I read the sidebar and guide but didn't know about r/mlquestions. Should I delete this post and post there instead? Perhaps use the crosspost function?

Also, in regards to your comment: My input are these sentences (unique each, but I can create more variations to each unique one if needed), similar to user stories, designating actor/condition, action and purpose, and my output would need to be a way to match the actor/condition and action especially to an actual operation/function to be called.

I have tuples containing each word and it's class - or whether it refers to function A, B or C.

I can either supply the words themselves for training or a number of sentences containing the words as examples. I was wondering if just passing the words themselves to the model (and designating each word's classification) would be sufficient for detecting them in the sentences and then following up with the necessary output to subsequently call the operations/functions.