Training algorithm for finding relationships within a data set
Given your example, if you want to group phrases based on terms, a simple approach would be to use grep to find rows that contain specific letter sequences (e.g. "art", "ball"). For example, say your table is a csv file (myfile.csv), where each line is a word or phrase (e.g. "Football", "Jazz music"). We can use a UNIX terminal to get all lines that contain "ball":

grep -n ball myfile.csv | cut -d: -f1 &gt; myresults.txt


This would yield a file (myresults.txt) that containts the lines numbers of phrases that contain "ball". You can also apply grep to a data frame version of your table using R or Python, so you can loop over different letter sequences and save the found relationships to a separate column of the data frame or a separate data frame or vector.