In this paper, we focus our attention on the problem of computing the ratio of two numbers, both of which are the summations of the private numbers distributed in different parties. Such a problem has been studied in the case that every party is semi-honest. Here we propose a solution to compute the ratio in the general case of multi-party. And we also assume that every party is semihonest. In addition, our new method is under a weaken assumption that some of the parties may collaborate together to extract information of other parties. This solution can be applied to a general class of problems in privacy-preserving data mining. We apply this protocol to Gibbs sampling for Latent Dirichlet Allocation model.