Creating explainable summaries of text documents with controllable levels of detail
In one implementation, a device receives relevancy parameters from a user interface indicative of how relevant different portions of a text document are to a user. The device segments the text document into segments based on the relevancy parameters. The device generates a summary of the text document using the segments. The device provides, to the user interface, the summary of the text document and an indication of how much each of the segments contributed to the summary.
1 . A method comprising:
presenting a user interface;
receiving, by a device, a parameter from the user interface that is provided by a user and indicative of a level of granularity for segmentation;
segmenting, by the device, a text document into segments based on the parameter;
generating, by the device, a summary of the text document using the segments and an Artificial Intelligence model;
generating, using an embedding model, a first embedding representation for a first segment of the segments;
generating a second embedding representation for the summary;
determining a degree of similarity of the first segment to the summary based on a comparison of the first embedding representation to the second embedding representation; and
providing, by the device and to the user interface, the summary of the text document and an indication representing the degree of similarity of the first segment to the summary.
2 . The method as in claim 1 , further comprising:
providing, to the user interface, a preview of the text document for presentation in conjunction with the summary.
3 . The method as in claim 2 , wherein the indication comprises a highlighting of the first segment and a highlighting of a portion of the summary to which the first segment contributed.
4 . The method as in claim 1 , wherein the segmenting is further based on a relevancy threshold.
5 . The method as in claim 4 , further comprising:
receiving, via the user interface, the relevancy threshold.
6 . The method of claim 1 , wherein the level of granularity includes sentence level or paragraph level.
7 . The method of claim 1 , wherein the providing the indication includes presenting text from the text document that corresponds to the first segment, a first visual representation to emphasize the text, and a second visual representation to emphasize a portion of the summary related to the first segment.
8 . The method of claim 1 , further comprising:
presenting an initial summary of the text document prior to receiving the parameter.
9 . An apparatus, comprising:
one or more network interfaces;
a processor coupled to the one or more network interfaces; and
a memory configured to store one or more instructions, that when executed by the processor, configure the processor to:
present a user interface;
receive a parameter from the user interface that is provided by a user and indicative of a level of granularity for segmentation;
segment a text document into segments based on the parameter;
generate a summary of the text document using the segments;
generate, using an embedding model, a first embedding representation for a first segment of the segments;
generate a second embedding representation for the summary;
determine a degree of similarity of the first segment to the summary based on the first embedding representation and the second embedding representation; and
provide, to the user interface, the summary of the text document and an indication of the degree of similarity of the first segment to the summary.
10 . The apparatus as in claim 9 , wherein the processor is further configured to:
provide, to the user interface, a preview of the text document for presentation in conjunction with the summary.
11 . The apparatus as in claim 10 , wherein the indication comprises a highlighting of the first segment and a highlighting of a portion of the summary to which the first segment contributed.
12 . The apparatus as in claim 9 , wherein the processor is configured to segment the text document based on a relevancy threshold.
13 . The apparatus as in claim 12 , wherein the processor is further configured to:
receive, via the user interface, the relevancy threshold.
14 . The apparatus of claim 9 , wherein the level of granularity includes sentence level or paragraph level.
15 . The apparatus of claim 9 , wherein the processor is configured to provide the indication by presenting text from the text document that corresponds to the first segment, a first visual representation to emphasize the text, and a second visual representation to emphasize a portion of the summary related to the first segment.
16 . The apparatus of claim 9 , wherein the processor is further configured to:
present an initial summary of the text document prior to receiving the parameter.
17 . A tangible, non-transitory, computer-readable medium storing program instructions that cause a device to execute a process comprising:
presenting a user interface;
receiving a parameter from the user interface that is provided by a user and indicative of a level of granularity for segmentation;
segmenting a text document into segments based on the parameter;
generating a summary of the text document using the segments;
generating, using an embedding model, a first embedding representation for a first segment of the segments;
generating a second embedding representation for the summary;
determining a degree of similarity of the first segment to the summary based on a comparison of the first embedding representation to the second embedding representation; and
providing, to the user interface, the summary of the text document and an indication of the degree of similarity of the first segment to the summary.
18 . The tangible, non-transitory, computer-readable medium of claim 17 , wherein the level of granularity includes sentence level or paragraph level.
19 . The tangible, non-transitory, computer-readable medium of claim 17 , wherein the providing the indication includes presenting text from the text document that corresponds to the first segment, a first visual representation to emphasize the text, and a second visual representation to emphasize a portion of the summary related to the first segment.
20 . The tangible, non-transitory, computer-readable medium of claim 17 , wherein the process further comprises:
presenting an initial summary of the text document prior to receiving the parameter.