1. A method for determining similarity between two input documents, comprising: detecting terms that occur in each of said input documents; segmenting each of said input documents into document segments, each segment being a predetermined part of said input document; generating document segment vectors, each vector including as its element values according to occurrence frequencies of said terms occurring in said respective document segments, where, a n-th document segment vector for a first one of said input documents S n (n=1,. .. , N) is represented by (s n1 , s n2 , s n3 ,. .. , s nk ) and a m-th document segment vector for a second one of said input documents T m (m=1,. .. , M) is represented by (t m1 , t m2 , t m3 ,. .. , t mk ), where S ni represents the occurrence frequency of an i-th term in a n-th document segment, and t mi represents the occurrence frequency of an i-th term in a m-th document segment; calculating by a processing device, for each of the two input documents, a squared inner product for all combinations of said document segment vectors contained in each input document, where the squared inner product is represented by 
 S n t T m =Σ k=1 K S nk T mk ; and determining said similarity between the two input documents based on a sum of said squared inner products.