Abstract:
A method determines a measure of similarity between a first document and a second document, in which a vector space model which takes into account word frequencies and coordinates is determined for the first document and for the second document. A measure of the similarity between the first document and the second document is determined using the vector space model. An apparatus, a computer program product and a storage medium are configured to execute the method.

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
       [0001]    This application claims the priority, under 35 U.S.C. §119, of German application DE 10 2012 025 349.4, filed Dec. 21, 2012; the prior application is herewith incorporated by reference in its entirety. 
       BACKGROUND OF THE INVENTION 
     Field of the Invention 
       [0002]    The invention relates to the determination of a measure of similarity between two documents and to processing of documents on the basis of a measure of similarity. 
         [0003]    Different text recognition (also referred to as optical character recognition (OCR)) methods which can be used to recognize text inside images in an automated manner are known. The images are, for example, electronically scanned documents, the content of which is intended to be analyzed further. 
         [0004]    The documents may be electronic documents, for example electronically processed, preprocessed or processable documents. The approach can be used, for example, in applications relating to document management or document archiving, for example of business documents, but can also be used for other types of data extraction, for example extraction of information from photographed till receipts and other small documents. 
         [0005]    In document management, index data relating to a document, for example sender, recipient, invoice number or invoice amount, play a central role. A document management system provides, for example, search functions using index data or archives a document using its index data. 
         [0006]    Index data extraction (also referred to as “extraction”) denotes automatic determination of index data relating to a document. In addition to rule-based methods, use is also made of learning methods which determine the index data relating to a document using similar documents (so-called training documents) whose index data have already been confirmed or corrected by a user. 
         [0007]    A measure of similarity for comparing documents is known. Distance determination methods (Euclidean distance, vector space models and probabilistic methods) are thus applied to the problem of determining the distance between documents. An overview of the different methods is found, for example, in an article by A. Huang, entitled “Similarity Measures for Text Document Clustering” edited by J. Holland, A. Nicholas, and D. Brignoli, and in New Zealand Computer Science Research Student Conference, pages 49-56, April 2008]. In this case, the sets of words of the two documents are generally compared (“bag of words” approach) and/or semantic analyses are carried out. 
         [0008]    An article by Michael W. Berry, Zlatko Drmac, and Elizabeth R. Jessup; entitled “Matrices, Vector Spaces, and Information Retrieval”, SIAM review, 1999, Vol. 41, No. 2, pages 335-362, relates to an analysis method for titles of documents in an archive. In this case, a measure of similarity between the words in the title is determined from expressions in the document by means of the cosine of a query and a document vector. 
         [0009]    An article by Jianying Hu, Ramanujan Kashi, and Gordon Wilfong; entitled “Document Image Layout Comparison and Classification, Document Analysis and Recognition”, 1999 uses a method in which a document page is subdivided into an m×n grid and it is determined whether or not each cell contains text. The information obtained is then used to infer a document type, for example whether the document is a letter, a professional article or a journal. 
         [0010]    An article by Daniel Esser et al.; entitled “Automatic Indexing of Scanned Documents—a Layout-based Approach, Document Recognition and Retrieval XIX”, Proc. of SPIE Vol. 8297, 82970H uses a method in which predetermined words are searched for in selected sectors of a document. This reduces a number of available templates of different document types to be evaluated. In this case, use is made of words which already exist in the underlying template with certain starting positions x and y inside the document. 
         [0011]    However, the known approaches have disadvantages if the determination of the similarity of documents whose text and layout need to be considered is involved. 
       SUMMARY OF THE INVENTION 
       [0012]    The object of the invention is to avoid the abovementioned disadvantages and to specify, in particular, an efficient solution for determining the similarity between electronic documents and to provide possibilities for processing documents which use a similarity between documents which is determined in this manner. 
         [0013]    In order to achieve the object, a method for determining a measure of similarity between a first document and a second document is proposed, in which a vector space model which takes into account word frequencies and coordinates is determined for the first document and for the second document, in which a measure of the similarity between the first document and the second document is determined using the vector space model. 
         [0014]    The present approach has the advantage that the text and the layout of the documents to be compared are taken into account for the purpose of determining the similarity. An additional advantage is that, in addition to the similarity of the documents, the similarity of the index data relating to the documents can also be taken into account. It is therefore possible, for example, to quickly identify a document which has been erroneously or deliberately provided with incorrect index data by a user. 
         [0015]    The present solution allows a suitable measure of the similarity between two documents to be determined, for example a function which assigns a value of between 0 and 1 to each tuple of two documents. In this case, this value is higher, the more similar the two documents are with respect to content (i.e. vocabulary) and layout and assume the value  1 , for example, when the two documents are identical. 
         [0016]    One development is that the coordinates of those words which occur together in both documents are taken into account. 
         [0017]    Another development is that the vector space model is determined by determining a first vector for the first document and a second vector for a second document. 
         [0018]    One development is, in particular, that the measure of the similarity is determined by determining a cosine between the first vector and the second vector. 
         [0019]    A development is also that a respective word vector is determined for the first document and for the second document. Elements of the word vectors indicate whether or not a word occurs in the respective document a word distance between the documents is determined. A respective coordinate vector is determined for the first document and for the second document. Elements of the word vectors indicating coordinates for words which occur together in the two documents. A coordinate distance between the documents is determined, and a total distance is determined on the basis of the word distance and the coordinate distance. 
         [0020]    For example, an element “1” denotes that the word occurs in the respective document (an element “0” accordingly denotes that the word does not occur and an element “4” denotes, for example, that the word occurs four times); the position of the element inside the word vector is linked to a particular word in this case. The coordinate vector contains, for example for each jointly occurring word in each document, two entries, for example for x and y coordinates within the respective document. 
         [0021]    One development involves determining the word distance using a cosine between the word vectors. 
         [0022]    One development also involves determining the coordinate distance using a cosine between the coordinate vectors. 
         [0023]    A next development involves determining the total distance according to 
         [0000]      (1 −p ) s+p·t    
         [0000]    where s denotes the word distance, t denotes the coordinate distance and p denotes a predefinable parameter. 
         [0024]    One refinement is that words occurring repeatedly in both documents are compared with one another in the coordinate vector according to one of the following mechanisms in accordance with their occurrence, using an assignment method in which those words for which the sum of the distances between the compared pairs is as small as possible are compared, using an assignment method in which those words for which the sum of the distances between the compared pairs is as large as possible are compared. 
         [0025]    In this case, the comparison denotes the use of identical positions inside the two vectors. 
         [0026]    The above object is also achieved by a method for processing an electronic document, in which a super ordinate database for extracting information is adapted on the basis of an electronic document if no documents which are sufficiently similar to the electronic document are present in the super ordinate database, the similarity between the electronic document and documents present in the super ordinate data bank being determined in accordance with the abovementioned method. 
         [0027]    This approach can be used repeatedly for a plurality of levels of super ordinate model spaces (model space corresponds to the abovementioned database here). 
         [0028]    In this case, it is advantageous that it is possible to interchange document information between individual users as a result of the cross-organizational approach. 
         [0029]    In the case of organization-based or company-based document management, users (for example companies) (also) provide a super ordinate model space (also referred to as a super ordinate database) or a multilevel hierarchy containing such super ordinate model spaces, for example, with their documents which have already been provided with correct index data. If another user now carries out extraction for a document, similar documents from the super ordinate model spaces can be used to determine the index data. 
         [0030]    In this case, the super ordinate model spaces can be used in different ways. 
         [0031]    First of all, the question arises of which documents from a user are intended to be supplied to the super ordinate model spaces up to which level of the hierarchy. On the one hand, it is desirable to provide only a small number of documents in terms of efficient storage space use. On the other hand, a large number of provided documents increases the likelihood of a current document being successfully indexed (that is to say of index data extraction for the current document being successful) by virtue of a sufficient number of similar documents being able to be provided. 
         [0032]    A set of documents which is as small as possible, but where the total set represents the documents of all users to be processed as well as possible with regard to their similarity, is therefore sought. 
         [0033]    An alternative embodiment involves adapting the super ordinate database by adding the electronic document or features of the electronic document to the super ordinate database. 
         [0034]    For example, index data or other data characteristic of the document can be added to the super ordinate database. 
         [0035]    A method for processing an electronic document is also proposed, in which a super ordinate database is used to extract information relating to the document, only those documents in the super ordinate database which have a predefined similarity to the electronic document being used, the similarity between the electronic document and documents present in the super ordinate data bank being determined in accordance with the method explained here. 
         [0036]    A next refinement is that the predefined similarity is determined by a threshold value comparison with a predefined minimum measure of similarity. 
         [0037]    A refinement is also that the super ordinate database is used to extract information relating to the document if the super ordinate database has more similar documents than a local database. 
         [0038]    The local database may be a local model space, in particular in the form of a data bank. The local database and the super ordinate database may contain already classified documents, document types, items of feedback from the user, data fields, values for data fields, etc. 
         [0039]    The super ordinate database may be a database of a further physical or logical unit which may be separate from a first unit containing the local database. 
         [0040]    In particular, it is possible to provide a plurality of super ordinate databases which are hierarchically arranged; accordingly, the present proposal can be carried out several times in succession in order to obtain a sufficiently good extraction result for the document across a plurality of hierarchical levels. 
         [0041]    A particular advantage of the solution presented is that the local database is used in a first step and the material (documents, classifications, fields, values, coordinates, etc.) already present locally is therefore used to produce the best possible classification result; this can be expected, in particular, for those document types which have already been extracted often and for which extensive extraction knowledge is accordingly stored in the local database. If no sufficient extraction knowledge is found locally, the escalation in the super ordinate database uses the information which is available there and possibly comes from a different organizational structure and/or from a different extraction service. 
         [0042]    The present solution makes it possible for a current user to benefit, in particular, from extraction results which have already been carried out, for example caused or carried out by other users or processes, by virtue of the extraction results being improved or only just enabled for the current user thereby. 
         [0043]    For example, extraction services in electronic documents (data extraction services and/or model spaces with training documents which are managed by the data extraction services) can be interconnected in a freely definable hierarchy, in particular without the current user being able to draw conclusions on the contents of the documents belonging to the other users. The confidentiality of the contents is therefore ensured and the extraction results which have already been carried out can nevertheless be used. 
         [0044]    The abovementioned object is also achieved by an apparatus for determining a measure of similarity between a first document and a second document, having a processing unit which is set up in such a manner that in which a vector space model which takes into account word frequencies and coordinates can be determined for the first document and for the second document, and in which a measure of the similarity between the first document and the second document can be determined using the vector space model. 
         [0045]    The object is also achieved by an apparatus for processing an electronic document, having a processing unit which is set up in such a manner that the steps of the method described herein can be carried out. 
         [0046]    The processing unit mentioned here may be, in particular, in the form of a processor unit, a computer or a distributed system of processor units or computers. In particular, the processing unit may have computers which are connected to one another via a network connection, for example via the Internet. 
         [0047]    The database may be or contains a data bank or a data bank management system. 
         [0048]    In particular, the processing unit may be or contains any type of processor or computer with accordingly required peripherals (memory, input/output interfaces, input/output devices, etc.). 
         [0049]    The above explanations relating to the method accordingly apply to the apparatus. The apparatus may be in one component or distributed in a plurality of components. 
         [0050]    One refinement is that the apparatus contains the local database and/or the super ordinate database. 
         [0051]    The abovementioned object is also achieved by a system containing at least one of the apparatuses described here. 
         [0052]    The solution presented here also contains a computer program product which can be loaded directly into a memory of a digital computer, containing program code parts which are suitable for carrying out steps of the method described here. 
         [0053]    The abovementioned problem is also solved by a non-transitory computer-readable storage medium, for example any desired memory, containing instructions (for example in the form of program code) which can be executed by a computer and are suitable for the computer to carry out steps of the method described here. 
         [0054]    The above-described properties, features and advantages of this invention and the manner in which they are achieved become more clearly and distinctly comprehensible in connection with the following schematic description of exemplary embodiments which are explained in more detail in connection with the drawings. For the sake of clarity, in this case, identical or identically acting elements can be provided with the identical reference symbols. 
         [0055]    Other features which are considered as characteristic for the invention are set forth in the appended claims. 
         [0056]    Although the invention is illustrated and described herein as embodied in a determination of a measure of similarity and processing of documents, it is nevertheless not intended to be limited to the details shown, since various modifications and structural changes may be made therein without departing from the spirit of the invention and within the scope and range of equivalents of the claims. 
         [0057]    The construction and method of operation of the invention, however, together with additional objects and advantages thereof will be best understood from the following description of specific embodiments when read in connection with the accompanying drawings. 
     
    
     
       BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING 
         [0058]      FIG. 1  is a schematic illustration of a propagation strategy of documents across model spaces; 
           [0059]      FIG. 2  is a schematic image of an invoice as an exemplary document with blocks, coordinates and recognized words; 
           [0060]      FIG. 3  is a schematic image of an invoice, which is similar but alternative to  FIG. 2 , with blocks, coordinates and recognized words; and 
           [0061]      FIG. 4  is a schematic image of a cover letter with blocks, coordinates and recognized words. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0062]    An approach based on two vector space models is proposed as a measure of similarity between documents. The documents are therefore transformed into a multidimensional vector and the cosine is calculated between two vectors. 
         [0063]    In the vector space models, it is possible to use the word frequencies and coordinates of the shared words which, if they occur repeatedly, are compared with the aid of a heuristic matching method. 
         [0064]    For example, use is made of a second vector space model which is used to carry out the method for the index data relating to the documents. The results of the two vector space models are then processed to form an overall result. 
         [0065]    A propagation strategy is now described. 
         [0066]    A document provided with index data by a user can be added to a hierarchy of the super ordinate model spaces. In this case, the hierarchy is run through from bottom to top and the most similar documents in each super ordinate model space are determined, the similarity of the documents being measured with the aid of the abovementioned vector space models. 
         [0067]    As long as a sufficient number of sufficiently similar documents is not in a super ordinate model space, the document is added to the super ordinate model space. When a number of similar documents is sufficient depends, for example, on the learning methods or on a (predefined or predefinable) number of similar documents which require this in order to ensure a sufficient quality of the index data extraction. The quality can be determined, for example, using a measure of extraction quality, for example by comparing the measure of quality with a predefined threshold value. 
         [0068]    When a document is sufficiently similar to be considered a “similar document” can also be determined using a threshold value. The process of running through the hierarchy is ended as soon as a super ordinate model space is found, to which the document is no longer intended to be added, or as soon as a super ordinate model space no longer exists. 
         [0069]      FIG. 1  shows a schematic illustration of the abovementioned propagation strategy. Two documents  102  and  103  from a model space  101  are provided with index data. 
         [0070]    A super ordinate model space  104  (first hierarchical level) contains four documents  105  to  108  and a further super ordinate model space  109  (second hierarchical level) contains four documents  110  to  113 . 
         [0071]    For document  102 , there are already similar documents  105  and  106  in the super ordinate model space  104 . Therefore, document  102  is not added to the super ordinate model space  104 . The further super ordinate model spaces are no longer checked for document  102 . 
         [0072]    For document  103 , there are no similar documents  105  to  108  in the super ordinate model space  104 . Document  103  is added to the super ordinate model space  104 . For document  103 , there is a similar document  112  in the super ordinate model space  109 . Therefore, document  103  is not added to the super ordinate model space  109 . 
         [0073]    The query strategy is now described. 
         [0074]    There are two query strategies: 
         [0000]    (1) In the first query strategy, every super ordinate model space is used for index data extraction. This constitutes the greatest possible certainty of obtaining actually similar documents during index data extraction but is runtime-intensive.
 
(2) In the second query strategy, the super ordinate model spaces are not fundamentally used for index data extraction. Instead, only the most similar documents from each super ordinate model space are determined (which is considerably less runtime-intensive than complete index data extraction). The similarity is again determined using the vector space models. Index data extraction is now extended to that super ordinate model space which contains the most similar documents and this is also affected only when the documents are more similar than the documents already available in the actual model space.
 
         [0075]    Further embodiments and advantages are now discussed. 
         [0076]    A first strategy for using a hierarchy of super ordinate model spaces in an organization-based document management process is proposed. In this case, the distance between documents is determined, with the similarity of the layout, of the vocabulary and of the index data being taken into account. 
         [0077]    Therefore, the present solution allows a strategy for collaboration and for interchanging documents, in particular in organization-based document management. 
         [0078]    Further statements on the vector space model are now described. 
         [0079]    The following example is intended to illustrate the procedure when calculating the distance between documents. 
         [0080]      FIG. 2  shows a document of an invoice from “Telekom” to “Hofmeier” with a plurality of text blocks whose upper left-hand corner is respectively linked to a coordinate of the document. The position of the respective text block in the document is therefore defined. By way of example, the coordinate origin (0.0) is in the upper left-hand corner. The invoice has, inter alia, two invoice items “landline” and “Internet”.  FIG. 3  shows a document of an invoice from “Telekom” to “Hofmeier” which, in contrast to  FIG. 2 , has three invoice items “landline”, “Internet” and “Entertain”.  FIG. 4  shows a further exemplary document of a cancellation from “Hofmeier” to “Telekom”. 
         [0081]    The documents shown in  FIGS. 2 to 4  each have approximately 12 words. The words with their upper left-hand indication of coordinates are, for example, the result of OCR preprocessing, for example after the documents have been scanned. In order to simplify the present example, the words occur at most once for each document. 
         [0082]    The documents in  FIGS. 2 and 3  are similar to one another since both invoices from the same invoicing party are addressed to the same addressee. The document according to  FIG. 3  is a “letter of cancellation” which, apart from very similar vocabulary, has only little similarity to the documents in  FIGS. 2 and 3 . 
         [0083]    The text below explains how a value can be determined for similarities between documents. For example, the value can vary between 0 (documents are fundamentally different from one another) and 1 (documents are identical). 
         [0084]    Calculation of distance between document  1  ( FIG. 2 ) and document  2  ( FIG. 3 ) is now described. 
         [0085]    Step 1: Determination of word vectors is now described. 
         [0086]    A vector is created for each of the two documents. The number of dimensions of the two vectors is identical and respectively corresponds to the number of different words occurring in total in the two documents. 
         [0087]    In the example, these are the words: “invoice”, “from”, “Telekom”, “to”, “Hofmeier”, “landline”, “Internet”, “Entertain”, “total”, “100         ” and “50         ”. Therefore, each vector has 11 dimensions. 
         [0088]    The value of a dimension in a document corresponds to the number of occurrences of the corresponding word. 
         [0089]    For the example, the following vectors result (document  1  according to  FIG. 2  on the left and document  2  according to  FIG. 3  on the right): 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         Invoice 
                       
                     
                     
                       
                         From 
                       
                     
                     
                       
                         Telekom 
                       
                     
                     
                       
                         To 
                       
                     
                     
                       
                         Hofmeier 
                       
                     
                     
                       
                         Landline 
                       
                     
                     
                       
                         Internet 
                       
                     
                     
                       
                         Entertain 
                       
                     
                     
                       
                         Total 
                       
                     
                     
                       
                         
                           100 
                           ∈ 
                         
                       
                     
                     
                       
                         
                           50 
                           ∈ 
                         
                       
                     
                   
                    
                   
                     ( 
                     
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           1 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   
                     
                       
                         Invoice 
                       
                     
                     
                       
                         From 
                       
                     
                     
                       
                         Telekom 
                       
                     
                     
                       
                         To 
                       
                     
                     
                       
                         Hofmeier 
                       
                     
                     
                       
                         Landline 
                       
                     
                     
                       
                         Internet 
                       
                     
                     
                       
                         Entertain 
                       
                     
                     
                       
                         Total 
                       
                     
                     
                       
                         
                           100 
                           ∈ 
                         
                       
                     
                     
                       
                         
                           50 
                           ∈ 
                         
                       
                     
                   
                    
                   
                     ( 
                     
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           0 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                     
                 
               
             
           
         
       
     
         [0090]    Step 2: Calculation of the word distance is now described. 
         [0091]    The word distance between the two documents corresponds to the cosine between their word vectors v 1  and v 2  according to: 
         [0000]    
       
         
           
             
               Scalar 
                
               
                   
               
                
               product 
                
               
                   
               
                
               
                 ( 
                 
                   
                     v 
                     1 
                   
                   , 
                   
                     v 
                     2 
                   
                 
                 ) 
               
             
             
               
                 Norm 
                  
                 
                   ( 
                   
                     v 
                     1 
                   
                   ) 
                 
               
               · 
               
                 Norm 
                  
                 
                   ( 
                   
                     v 
                     2 
                   
                   ) 
                 
               
             
           
         
       
     
         [0092]    The scalar product s of two vectors v 1 =(x 1 , . . . , x n ) and v 2 =(y 1 , . . . , y n ) is calculated as follows in this case: 
         [0000]    
       
         
           
             s 
             = 
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 n 
               
                
               
                 ( 
                 
                   
                     x 
                     i 
                   
                   · 
                   
                     y 
                     i 
                   
                 
                 ) 
               
             
           
         
       
     
         [0093]    The norm of a vector v=(x 1 , . . . , x n ) is determined by: 
         [0000]    
       
         
           
             t 
             = 
             
               
                 
                   ∑ 
                   
                     i 
                     = 
                     1 
                   
                   u 
                 
                  
                 
                   x 
                   i 
                   2 
                 
               
             
           
         
       
     
         [0094]    In the example, the following therefore results as the word distance: 
         [0000]    
       
         
           
             
               Word 
                
               
                   
               
                
               distance 
             
             = 
             
               
                 8 
                 
                   
                     0 
                   
                   · 
                   
                     10 
                   
                 
               
               ≈ 
               0.81 
             
           
         
       
     
         [0095]    Step 3: Construction of the coordinate vectors is now described. 
         [0096]    A vector is created for each of the two documents. The number of dimensions of the two vectors is identical and respectively corresponds to twice the number of words occurring in both documents. 
         [0097]    If a word repeatedly occurs in both documents (not the case in the example for the sake of simplicity), the number of dimensions is accordingly increased. If a word occurs three times in the first document and five times in the second document, for example, six (two times three) dimensions are added to the vectors for this word. 
         [0098]    Assuming the word “hello” occurs five times in the first document and three times in the second document, three pairs of “hello” assignments are formed, for example: 
         [0000]    1. the first “hello” from document  1  and the first “hello” from document  2 ,
 
2. the third “hello” from document  1  and the second “hello” from document  2 , and
 
3. the fifth “hello” from document  1  and the third “hello” from document  2 .
 
         [0099]    Since document  2  contains the word “hello” only three times, three pairs are formed. Each word pair formed preferably has two dimensions, namely the x and y coordinates as positions in the respective document. Six additional dimensions therefore result for the vector. 
         [0100]    Alternatively, it is possible to compare each occurrence of the word “hello” in document  1  with each occurrence of the word “hello” in document  2  in a separate pair and therefore to form  15  pairs (each with two dimensions for the coordinates). 
         [0101]    In particular, all possible pairs of words occurring in both documents can be compared using an assignment method. 
         [0102]    In the example, the words which occur repeatedly in both documents are: “invoice”, “from”, “Telekom”, “to”, “Hofmeier”, “landline”, “Internet” and “total”. Therefore, each vector has 16 (two times eight, two coordinates for each shared word) dimensions. 
         [0103]    In the two dimensions of a word, its x and y coordinates are used as values. 
         [0104]    For the example, the following vectors result (on the left for document  1  and on the right for document  2 ): 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         Invoice 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         From 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Telekom 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         To 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Hofmeier 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Landline 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Internet 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Total 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                   
                    
                   
                     ( 
                     
                       
                         
                           6 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           5 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           8 
                         
                       
                       
                         
                           5 
                         
                       
                       
                         
                           8 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           13 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           15 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           18 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   
                     
                       
                         Invoice 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         From 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Telekom 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         To 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Hofmeier 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Landline 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Internet 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Total 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                   
                    
                   
                     ( 
                     
                       
                         
                           6 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           5 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           8 
                         
                       
                       
                         
                           5 
                         
                       
                       
                         
                           8 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           13 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           15 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           20 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                     
                 
               
             
           
         
       
     
         [0105]    Step 4: Calculation of a coordinate distance is now described. 
         [0106]    The coordinate distance between the two documents corresponds to the cosine between their coordinate vectors. This is likewise calculated with the formula already mentioned. In the example, the following coordinate distance then results: 
         [0000]    
       
         
           
             
               Coordinate 
                
               
                   
               
                
               distance 
             
             = 
             
               
                 1048 
                 
                   
                     1012 
                   
                   · 
                   
                     1088 
                   
                 
               
               ≈ 
               0.99 
             
           
         
       
     
         [0107]    Step 5: Determination of the total distance from the word distance and coordinate distance is now described. 
         [0108]    The word distance s and the coordinate distance t are now calculated according to the formula 
         [0000]      (1 −p ) s+p·t    
         [0000]    to form a total distance. The parameter p corresponds to a predefined constant of less than 1. 
         [0109]    The calculation means the following: If the word distance has a very low value (which corresponds to a long distance), it is given a high weighting and if, in contrast, it has a very high value (which corresponds to a very short distance), it is given a low weighting and the coordinate distance is accordingly given a high weighting. 
         [0110]    In the example, the following results are now discussed. 
         [0111]    Total distance: 0.16*0.84+0.84*0.99 0.96 
         [0112]    Calculation of distance between document  1  ( FIG. 2 ) and document  3  ( FIG. 4 ) is now described. 
         [0113]    The distance between document  1  and document  3  is calculated in a corresponding manner and is therefore explained only briefly in order to discern how the different layout of the two documents has an effect on the distance. 
         [0114]    The following word vectors result: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         Invoice 
                       
                     
                     
                       
                         From 
                       
                     
                     
                       
                         Telekom 
                       
                     
                     
                       
                         To 
                       
                     
                     
                       
                         Hofmeier 
                       
                     
                     
                       
                         Landline 
                       
                     
                     
                       
                         Internet 
                       
                     
                     
                       
                         Total 
                       
                     
                     
                       
                         
                           50 
                           ∈ 
                         
                       
                     
                     
                       
                         Cancellation 
                       
                     
                     
                       
                         Reason 
                       
                     
                     
                       
                         for 
                       
                     
                     
                       
                         too 
                       
                     
                     
                       
                         high 
                       
                     
                   
                    
                   
                     ( 
                     
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   
                     
                       
                         Invoice 
                       
                     
                     
                       
                         From 
                       
                     
                     
                       
                         Telekom 
                       
                     
                     
                       
                         To 
                       
                     
                     
                       
                         Hofmeier 
                       
                     
                     
                       
                         Landline 
                       
                     
                     
                       
                         Internet 
                       
                     
                     
                       
                         Total 
                       
                     
                     
                       
                         
                           50 
                           ∈ 
                         
                       
                     
                     
                       
                         Cancellation 
                       
                     
                     
                       
                         Reason 
                       
                     
                     
                       
                         for 
                       
                     
                     
                       
                         too 
                       
                     
                     
                       
                         high 
                       
                     
                   
                    
                   
                     ( 
                     
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                       
                         
                           1 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                     
                 
               
             
           
         
       
     
         [0115]    The word distance therefore results as: 
         [0000]    
       
         
           
             
               7 
               
                 
                   9 
                 
                 · 
                 
                   12 
                 
               
             
             ≈ 
             0.67 
           
         
       
     
         [0116]    The following result as coordinate vectors 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         Invoice 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         From 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Telekom 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         To 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Hofmeier 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Landline 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Internet 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                   
                    
                   
                     ( 
                     
                       
                         
                           6 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           5 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           8 
                         
                       
                       
                         
                           5 
                         
                       
                       
                         
                           8 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           13 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           15 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                     
                 
               
             
             
               
                 
                   
                     
                       
                         Invoice 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         From 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Telekom 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         To 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Hofmeier 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Landline 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                     
                       
                         Internet 
                       
                     
                     
                       
                         
                             
                         
                       
                     
                   
                    
                   
                     ( 
                     
                       
                         
                           5 
                         
                       
                       
                         
                           12 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           5 
                         
                       
                       
                         
                           8 
                         
                       
                       
                         
                           0 
                         
                       
                       
                         
                           8 
                         
                       
                       
                         
                           5 
                         
                       
                       
                         
                           4 
                         
                       
                       
                         
                           13 
                         
                       
                       
                         
                           12 
                         
                       
                       
                         
                           17 
                         
                       
                       
                         
                           12 
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                     
                 
               
             
           
         
       
     
         [0000]    and the coordinate distance therefore results as 
         [0000]    
       
         
           
             
               680 
               
                 
                   672 
                 
                 · 
                 
                   1125 
                 
               
             
             ≈ 
             0.78 
           
         
       
     
         [0117]    The total distance is therefore approximately 0.74. 
         [0118]    Further variation possibilities are now described. 
         [0119]    If a word repeatedly occurs in both documents, a decision should be made regarding which occurrences are “compared” (or assigned) in the coordinate vector. The following variants result here, for example: 
         [0000]    a). The first occurrence of the word in document  1  is assigned to the first occurrence of the word in document  2 . Accordingly, the second occurrence of the word in document  1  is assigned to the second occurrence of the word in document  2 , etc.
 
b). An assignment method is used in which the occurrences of the word are compared in such a manner that the sum of the distances between the compared pairs is as small as possible.
 
c. An assignment method is used in which the occurrences of the word are compared in such a manner that the sum of the distances between the compared pairs is as large as possible.
 
         [0120]    One variation is the choice of the parameter p when calculating the total distance from the word distance and the coordinate distance. For example, p=0.5 (or any other constant less than one) could be selected. 
         [0121]    Although the invention was described and illustrated in more detail by means of the at least one exemplary embodiment shown, the invention is not restricted thereto and other variations can be derived therefrom by a person skilled in the art without departing from the scope of protection of the invention.