Package edu.ucla.sspace.util

Examples of edu.ucla.sspace.util.PartitioningNearestNeighborFinder


                        Math.min((int)(Math.ceil(Math.log(numWords))), 1000);
                    System.err.printf("Choosing a heuristically selected %d " +
                                      "principle vectors%n",
                                      numPrincipleVectors);
                }
                nnf = new PartitioningNearestNeighborFinder(
                    sspace, numPrincipleVectors);
            } catch (IOException ioe) {
                throw new IOError(ioe);
            }
        }
View Full Code Here


            }
           
            // If this is the first time the nearest neighbors have been
            // searched for, construct a new NNF
            if (currentNnf == null)
                currentNnf = new PartitioningNearestNeighborFinder(current);

            // Using the provided or default arguments find the closest
            // neighbors to the target word in the current semantic space
            SortedMultiMap<Double,String> mostSimilar =
                currentNnf.getMostSimilar(focusWord, neighbors);
View Full Code Here

        final PrintWriter outputWriter = new PrintWriter(output);
           
        final Set<String> words = sspace.getWords();
        NearestNeighborFinder nnf =
            new PartitioningNearestNeighborFinder(sspace);


        for (String word : words) {           
            // compute the k most-similar words to this word
            SortedMultiMap<Double,String> mostSimilar =
                nnf.getMostSimilar(word, numSimilar);
           
            // once processing has finished write the k most-similar words to
            // the output file.
            StringBuilder sb = new StringBuilder(256);
            sb.append(word).append("|");
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.util.PartitioningNearestNeighborFinder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.