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.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.