count occurrences of string in acell of cells array (How many times a string appear) /*naive baies algorthim -cs*/
2 次查看(过去 30 天)
显示 更早的评论
i have given alarge single cell name Vocabulary.
Vocabulary = {'aaa','acc','champion'...,'zzz'} //all the words existing in all documents below without repitions
i also have given acell of cells array named alldocuments
alldocuments={{37*1 cell} ,{128*1 cell}...}
each cell includes words and category /* there are 3 categories sports ,science ,politics */
for example :
sports=alldoucments{1} 'aaa' , 'c','zzz','a','c','aaa'... /* 37 *1 cell/*
science=alldoucments {2} ='aaa' ,'q' ... /* 128*1 cell */
sports=alldocuments{3}= 'champoin', 'first'...
my main goal is to count for each word in vocabulary the number of occurrences according to the categories. for example { sports = 'aaa'=100 'acc'=0 'champion'=1000 ... scince ='aaa'=2 'acc'=5 champion=320... and so on for politics if anyone can help me he will save my week not only my day!!:) Your suggestion and ideas are highly appreciated. Thanx in advance
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!