Most clustering examples on the net are unsupervised learning. There is a given vectorization into a 2D space and the algorithm discovers clusters.

However, what if the input data that I want it to train for is desired clustering? So that the training data would be similar to classification, but in an open ended result set.

An example would be this list of entries

  • Susan walks
  • Susan is sitting.
  • Hear Susan sing.
  • David walks
  • Robert sits

The verbs (intents) are finite, Walk, Sing, Sit. But in addition to classification of intent, I also need to cluster the intents to identify the entities. This is an open ended set.

If I have 100 000 records of data on this form with identified verb and entity.

Susan walks      | Walk | Susan
Susan is sitting | Sit  | Susan
Hear Susan sing  | Sing | Susan
David walks      | Walk | David
Robert sits      | Sit  | Robert

The language has been simplified in this example. The point is that there may be variations on phrasing, but it is pretty simple english. The input data will have a lot of different names.

I would like an engine that would be good at classifying intent (easily solved), but it should also group together the intents that are likely to refer to the same person. So that the runtime can encounter "Alexander" and will be able to cluster his datapoints even though the name wasn't in the training data.

Is this poissible? What sort of algorithm is this?

And what would the training data look like?

Susan walks      | Walk | PersonA
Susan is sitting | Sit  | PersonA
Hear Susan sing  | Sing | PersonA
David walks      | Walk | PersonB
Robert sits      | Sit  | PersonC

I want the algorithm to identify the correct clusters. I don't want the names "Susan" or "David" in the last column. Nor do I want "PersonA" there, because it would be just as correct to call Susan "PersonB". But I want some way of indicating desirable clustering without naming them.

Most clustering examples I have looked at have already solved the problem of vectorization. But I want the computer to decide the correct vectorization to use that will produce the desirable clustering.

I took a look at LUIS that does a separation between intent and entities. But it seemed that the "entity" was just another classification within a predefined set. Not that you could use the data to discover entity instances.


1 Answer 1


My first reaction was that this is clearly not clustering, in the sense that clustering is an unsupervised task. Imho it's a complex combination of several tasks, My idea, possibly not the only one:

  • Fist a custom NER model would detect the two kinds of indicators, mainly person names and intent verbs. Possibly there are other words which contribute to knowing the intent or the person.
  • Then have a method (probably heuristic) for deciding the intent and the person in case of ambiguity. For example, "Mary gives a flower to John" would generate two names. Also the NER will likely generate errors sometimes.

Note that this method should in theory work even with new actions and/or new people, because NER classifies based on context words. But it will require a good amount of training data.

  • $\begingroup$ I was thinking that the classification of verbs and identification of entities is two completely separate tasks unless there is a synergy between them in that the content that identified by the verb can be removed before identifying the entities. It is not given that a person is to be recognized by a single word only. We can have a Susan1, Susan2, Susan Parker and Susan Baker. All data points can be assumed to be a entity/intent pair. $\endgroup$
    – Tormod
    Oct 3, 2022 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.