newBag= removeDocument(袋,idx)removes the documents with indices specified byidxfrom the bag-of-words or bag-of-n-grams model袋. If the removed documents contain words or n-grams that do not appear in the remaining documents, then the function also removes these words or n-grams from袋.
Remove selected documents from a bag-of-words model.
documents = tokenizedDocument([..."an example of a short sentence""a second short sentence""a third example""a final sentence"]); bag = bagOfWords(documents)
袋= bagOfWords with properties: Counts: [4x9 double] Vocabulary: ["an" "example" "of" "a" "short" ... ] NumWords: 9 NumDocuments: 4
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.