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