This is further part of question which I asked here . So I have decided to put it as another question.
Is there any way so that I can add the relevance value beside each matched list name in column matched_list_names
. So relevance value formula would be (number of matched words from list/total number of words in that list)*100
in order to get which list name is most relevant.So, for first row for politics relevance would be (1/3)*100=30%
i.e 1 word get matched out of total 3 words in list politics same for sports it would be (1/3)*100=0.3
and for miscellaneous value is 100-(sum of total value)
i.e (100-(30+30)
. So, output would be like:-
word_list matched_list_names
['nuclear','election','usa','baseball'] politics 30,sports 30,miscellaneous 40
['football','united','thriller'] sports 30,movies 30,miscellaneous 40
['marvels','spiderman','hockey'] movies 60,sports 30
.................... .....................
.................... .....................
.................... ....................