A simple solution: count the occurrence of text in the text.
To do a good job, although this is a difficult problem that companies like Google have been working with for many years. If possible, you can take a look at using your technology.
To expand, try the following:
. , , , , .