예제 #1
0
        public void CopyModel(LdaSingleBox trainer, int wordId)
        {
            int length = NumTopic;

            LdaInterface.GetWordTopic(trainer._engine, wordId, _topics, _probabilities, ref length);
            LdaInterface.SetWordTopic(_engine, wordId, _topics, _probabilities, length);
        }
예제 #2
0
        public KeyValuePair <int, int>[] GetModel(int wordId)
        {
            int length = NumTopic;

            LdaInterface.GetWordTopic(_engine, wordId, _topics, _probabilities, ref length);
            var wordTopicVector = new KeyValuePair <int, int> [length];

            for (int i = 0; i < length; i++)
            {
                wordTopicVector[i] = new KeyValuePair <int, int>(_topics[i], _probabilities[i]);
            }
            return(wordTopicVector);
        }