newBag = removeInfrequentWords(bag,count)
removes the words that appear at most count times in total from
the bag-of-words model bag. The function, by default, is case
sensitive.
newBag = removeInfrequentWords(bag,count,'IgnoreCase',true)
removes the words that appear at most count times in total
ignoring case. If words differ only by case, then the corresponding counts are
merged.
Remove the words that appear two times or fewer from a bag-of-words model.
Create a bag-of-words model from an array of tokenized documents.
documents = tokenizedDocument([
"an example of a short sentence""a second short sentence""another example""a short example"]);
bag = bagOfWords(documents)
bag =
bagOfWords with properties:
NumWords: 8
Counts: [4×8 double]
Vocabulary: ["an" "example" "of" "a" "short" "sentence" "second" "another"]
NumDocuments: 4
Remove the words that appear two times or fewer from the bag-of-words model.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.