%% Summarize Documents
% Create an array of tokenized documents.

str = [
    "The quick brown fox jumped over the lazy dog."
    "The fox jumped over the dog."
    "The lazy dog saw a fox jumping."
    "There seem to be animals jumping other animals."
    "There are quick animals and lazy animals"];
documents = tokenizedDocument(str);

% Extract a summary of the documents using the extractSummary function. The function, by default, chooses 1/10 of the input documents, rounding up.

summary = extractSummary(documents)

% To specify a larger summary, use the 'SummarySize' option. Extract a three-document summary.

summary = extractSummary(documents,'SummarySize',3)

% Copyright 2019 The MathWorks, Inc.