Usually when performing text document clustering, similarities across documents are assessed based on the lexical content of documents. But, in my problem, I wish to consider both the lexical content and the ontology of documents while assessing similarities. I'll explain this with an example.
I have documents arranged in a tree structure as in the figure below. . Here, lets say, documents admod and customevent (leaf nodes) have a lexical similarity X (X is a real number). It could be noticed that these documents lie close to each other in the tree. Lets say, their distance in the tree is Y. Hence, while assessing similarity between these 2 documents, I wish to have
Similarity (admod, customevent) = f(X,Y), where f is an appropriate function (mapping)
Extending this example further, say the documents admob and Task Manager (root node) bear the same lexical similarity X. It could be observed that these 2 documents lie far apart in the tree. Say, they are Z units apart (where Z > Y), then, I require the similarity function to satisfy the following constraint,
Similarity (admod, customevent) > Similarity (admod, Task Manager)
as admob & customevent lie closer in the tree.
Please suggest on how to combine (include) the tree structure while assessing the similarities.
NOTE: The tree structure is inferred through domain expertise.