Hello. Please any one can help me with word frequency?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a text, and after I arrange the text in a descending column, I want each frequency beside the word.
0 commentaires
Réponses (1)
Walter Roberson
le 20 Fév 2017
Use the three output form of unique(). Use accumarray or histogram or histc to do the counting of the values from the third output of unique
2 commentaires
Walter Roberson
le 20 Fév 2017
Sorry, you will need to be more specific in pointing out features of your text that make it difficult to use the procedure I outlined.
I am presuming that you have already worked out how to break the text up into "words" for your purpose, taking into account that in the string 'cold.' that the word is "cold" and "." is punctuation, but in 'E.g.,' that the word is "e.g." including "." as part of the word and "," is punctuation, but in '1,209,600' that the word is the entire string and "," is not punctuation there. But in '99.5%' is the word "99.5" and "%" is pseudo-punctuation, or is the "%" part of the word? And how about '-5%+20%', are the words "5" and "20" or "-5" and "+20" or "-5%" and "+20%" or is it all one word "-5%+20%" ?
Fortunately as you have already arranged the text in descending order, you have already worked that all out.
Voir également
Catégories
En savoir plus sur Battery Pack Modeling dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!