%% Evaluate Document Importance
% 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 over other animals."
    "There are quick animals and lazy animals"];
documents = tokenizedDocument(str);

% Extract a three-document summary. The second output scores contains the summary document importance scores.

[summary,scores] = extractSummary(documents,'SummarySize',3)

% Visualize the scores in a bar chart.

figure
bar(scores)
xlabel("Summary Document")
ylabel("Score")
title("Summary Document Importance")

% Copyright 2019 The MathWorks, Inc.