Discovery of document templates in a document management system
A system, for example, a document management system stores documents and manages workflows associated with documents. The document management system allows discovery of templates based on explicit searches performed by users or automatic searches performed based on a context. The document management system allows generating new document templates based on selected versions of document component templates. The generated document template may be stored as a new version. The document management system instantiates documents based on templates by predicting values of variables used in the template based on various factors that describe the context in which the template is being used. The values used for instantiating variables may be generated using machine learning models that may be trained using historical data stored in the document management system.
1 . A computer-implemented method for selecting a version of a template for a document, the computer-implemented method comprising:
storing, by a document management system, a repository of document templates, each document template in the repository is associated with a document type, the repository storing a set of versions of document templates for each document type, wherein a version of a document template is associated with a context determined based on at least one of information describing a document workflow being executed by the document management system or information describing one or more participants of the document workflow;
receiving information describing a current document workflow being executed by the document management system, the current document workflow having one or more participants;
determining a current context based on the information describing the current document workflow and the information describing the one or more participants of the current document workflow;
identifying a document type based on the current document workflow;
generating, using the current context, a ranked list of document templates from the repository of document templates;
selecting, from the ranked list of document templates, a version of a document template of the document type responsive to the context associated with the version of the document template of the document type matching the current context, the version of the document template comprising text of a document and a variable;
predicting a value of the variable for the document using a machine learning model based on the current context and one or more actions already executed in the document workflow, wherein the machine learning model has been trained using one or more historical values associated with one or more historical variables in one or more historical contexts and used by the one or more participants in the one or more historical contexts, the one or more historical variables representing at least one of a data source for performing one or more actions in the document workflow or one or more actions in the document workflow; and
executing one or more operations of the document workflow using the document based on the selected version of the document template.
2 . The method of claim 1 , further comprising:
storing one or more versions of the document template, comprising storing a representation of a context for each version of the document template.
3 . The method of claim 2 , wherein storing a version of the document template comprises:
receiving a new document template for the document type and a corresponding context of the new document template;
matching the context of the new document template with contexts of each of the one or more stored versions of the document template; and
responsive to determining that none of the contexts of the one or more stored versions of the document template match the context of the new document template, storing the new document template as a new version of the document template and storing the new version in association with the context of the new document template.
4 . The method of claim 1 , wherein selecting the version of the document template comprises:
comparing the current context with contexts associated with each of one or more stored versions of the document template.
5 . The method of claim 4 , wherein each context is represented as a feature vector, wherein comparing the current context with a context of a stored version of the document template comprises determining a vector distance between the feature vector representing the current context and a feature vector representing the context stored with the version of the document template.
6 . The method of claim 5 , wherein a feature vector representation of a particular context is determined by performing operations comprising:
providing a representation of the particular context as input to a neural network; and
extracting an embedding generated by a hidden layer of the neural network as the feature vector representation of the particular context.
7 . The method of claim 1 , wherein information describing one or more participants of the document workflow comprises a category of an organization represented by a participant.
8 . The method of claim 1 , wherein the information describing the document workflow being executed by the document management system comprises information identifying operations of the document workflow being currently executed.
9 . The method of claim 1 , wherein the current document workflow includes one or more operations comprising: a document signing operation, an identity verification operation, or an operation of configuring and presenting a form for receiving information.
10 . A non-transitory computer-readable storage medium storing executable instructions that, when executed by one or more computer processors, cause the one or more computer processors to
store, by a document management system, a repository of document templates, document template associated with a document type, the repository storing a set of versions of document templates for each document type, wherein a version of a document template is associated with a context determined based on at least one of information describing a document workflow being executed by the document management system or information describing one or more participants of the document workflow;
receive information describing a current document workflow being executed by the document management system, the current document workflow having one or more participants;
determine a current context based on information describing the current document workflow and the information describing the one or more participants of the current document workflow;
identify a document type based on the current document workflow;
generate, using the current context, a ranked list of document templates from the repository of document templates;
select, from the ranked list of document templates, a version of a document template of the document type responsive to the context associated with the version of the document template of the document type matching the current context, the version of the document template comprising text of a document and a variable;
predict a value of the variable for the document using a machine learning model based on the current context and one or more actions already executed in the document workflow, wherein the machine learning model has been trained using one or more historical values associated with one or more historical variables in one or more historical contexts and used by the one or more participants in the one or more historical contexts, the one or more historical variables representing at least one of a data source for performing one or more actions in the document workflow or one or more actions in the document workflow; and
execute one or more operations of the document workflow using the document based on the selected version of the document template.
11 . The non-transitory computer-readable storage medium of claim 10 , further causing the one or more computer processors to
store one or more versions of the document template, comprising store a representation of a context for each version of the document template.
12 . The non-transitory computer-readable storage medium of claim 10 , wherein instructions for storing a version of the document template cause the one or more computer processors to
receive a new document template for the document type and a corresponding context of the new document template;
match the context of the new document template with contexts of each of one or more stored versions of the document template; and
responsive to a determination that none of the contexts of the one or more stored versions of the document template match the context of the new document template, store the new document template as a new version of the document template and store the new version in association with the context of the new document template.
13 . The non-transitory computer-readable storage medium of claim 10 , wherein instructions for selecting the version of the document template cause the one or more computer processors to
compare the current context with contexts associated with each of one or more stored versions of the document template.
14 . The non-transitory computer-readable storage medium of claim 13 , wherein each context is represented as a feature vector, wherein compare the current context with a context of a stored version of the document template comprises determine a vector distance between the feature vector representing the current context and a feature vector representing the context stored with the version of the document template.
15 . The non-transitory computer-readable storage medium of claim 14 , wherein instructions for determining a feature vector representation of a particular context cause the one or more computer processors to
provide a representation of the particular context as input to a neural network; and
extract an embedding generated by a hidden layer of the neural network as the feature vector representation of the particular context.
16 . A computer system, comprising:
one or more computer processors; and
a non-transitory computer-readable storage medium storing executable instructions that, when executed by the one or more computer processors, cause the one or more computer processors to
store, by a document management system, a repository of document templates, document template associated with a document type, the repository storing a set of versions of document templates for each document type, wherein a version of a document template is associated with a context determined based on at least one of information describing a document workflow being executed by the document management system and information describing one or more participants of the document workflow;
receive information describing a current document workflow being executed by the document management system, the current document workflow having one or more participants;
determine a current context based on information describing the current document workflow and the information describing the one or more participants of the current document workflow;
identify a document type based on the current document workflow;
generate, using the current context, a ranked list of document templates from the repository of document templates;
select, from the ranked list of document templates, a version of a document template of the document type responsive to the context associated with the version of the document template of the document type matching the current context, the version of the document template comprising text of a document and a variable;
predict a value of the variable for the document using a machine learning model based on the current context and one or more actions already executed in the document workflow, wherein the machine learning model has been trained using one or more historical values associated with one or more historical variables in one or more historical contexts and used by the one or more participants in the one or more historical contexts, the one or more historical variables representing at least one of a data source for performing one or more actions in the document workflow or one or more actions in the document workflow; and
execute one or more operations of the document workflow using a document based on the selected version of the document template.
17 . The computer system of claim 16 , wherein instructions for storing a version of the document template cause the one or more computer processors to
receive a new document template for the document type and a corresponding context of the new document template;
match the context of the new document template with contexts of each of one or more stored versions of the document template; and
responsive to a determination that none of the contexts of the one or more stored versions of the document template match the context of the new document template, store the new document template as a new version of the document template and store the new version in association with the context of the new document template.
18 . The computer system of claim 16 , wherein instructions for selecting the version of the document template cause the one or more computer processors to
compare the current context with contexts associated with each of one or more stored versions of the document template.
19 . The computer system of claim 18 , wherein each context is represented as a feature vector, wherein compare the current context with a context of a stored version of the document template comprises determine a vector distance between the feature vector representing the current context and a feature vector representing the context stored with the version of the document template.
20 . The computer system of claim 19 , wherein instructions for determining a feature vector representation of a particular context cause the one or more computer processors to
provide a representation of the particular context as input to a neural network; and
extract an embedding generated by a hidden layer of the neural network as the feature vector representation of the particular context.