title: Is there a way to train an ML model to classify words into categories?
body: <p>I'm looking to train an ML model to classify words into several broad categories, in my case: color. So I'll have some pre-defined color buckets like these for example:</p>
  
  <pre><code>let blue = ["blue", "royal", "dark blue", "light blue"]
  let red = ["red", "cardinal", "dusty red", "red polka dot"]
  </code></pre>
  
  <p>And I want</p>
  
  <p>a) For the model to classify colors already existing in the buckets, i.e. if given "blue" it will know that "blue" is in the <code>blue</code> bucket.</p>
  
  <p>b) For the model to take words not seen before, such as "faded blue", and to classify them in the correct bucket, in this case <code>blue</code> based on a confidence score of some sort.</p>
  
  <p>I'm not sure if this is possible and the current method I have is a series of if statements to go about the classifying, but I'm wondering if there is a more intuitive way to do this with an ML model.</p>