newBag = removeDocument(bag,idx)는 idx로 지정된 인덱스를 갖는 문서를 bag-of-words 모델 또는 bag-of-n-grams 모델 bag에서 제거합니다. 제거된 문서에 나머지 문서에는 없는 단어나 n-gram이 들어 있는 경우 이 함수는 그러한 단어나 n-gram도 bag에서 제거합니다.
documents = tokenizedDocument([ ..."an example of a short sentence""a second short sentence""a third example""a final sentence"]);
bag = bagOfWords(documents)
bag =
bagOfWords with properties:
Counts: [4x9 double]
Vocabulary: ["an" "example" "of" "a" "short" "sentence" "second" "third" "final"]
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.