Package edu.ucla.sspace.wordsi

Examples of edu.ucla.sspace.wordsi.AssignmentReporter


     */
    protected SemanticSpace getSpace() {
        ArgOptions options = argOptions;
        // Setup the assignment reporter.  When training, the assignment report
        // will only be used If the evaluation mode will be for pseudoWord.
        AssignmentReporter reporter = null;
        if (options.hasOption('P'))
            reporter = new PseudoWordReporter(System.out);

        int numClusters = options.getIntOption('c', 0);

View Full Code Here


*/
public class PseudoWordReporterTest {

    @Test public void testUpdateAssignment() {
        OutputStream stream = new ByteArrayOutputStream();
        AssignmentReporter reporter = new PseudoWordReporter(stream);
        reporter.updateAssignment("catdog", "dog", 5);
        reporter.updateAssignment("catdog", "dog", 2);
        reporter.updateAssignment("catdog", "dog", 5);
        reporter.updateAssignment("catdog", "cat", 1);
        reporter.updateAssignment("catdog", "cat", 1);
        reporter.updateAssignment("catdog", "cat", 5);
        reporter.finalizeReport();

        String computed = stream.toString();
        System.out.println(computed);
        int[] dogCounts = new int[] {0, 0, 1, 0, 0, 2};
        int[] catCounts = new int[] {0, 2, 0, 0, 0, 1};
View Full Code Here

        }
    }

    @Test public void testAssignContextToKey() {
        OutputStream stream = new ByteArrayOutputStream();
        AssignmentReporter reporter = new PseudoWordReporter(stream);

        reporter.assignContextToKey("catdog", "cat", 1);
        reporter.assignContextToKey("catdog", "dog", 0);
        reporter.assignContextToKey("catdog", "dog", 2);
        reporter.assignContextToKey("catdog", "dog", 3);

        String[] expected = new String[] {"dog", "cat", "dog", "dog"};
        String[] computed = reporter.contextLabels("catdog");
        assertEquals(expected.length, computed.length);
        for (int i = 0; i < expected.length; ++i)
            assertEquals(expected[i], computed[i]);
    }
View Full Code Here

*/
public class SemEvalReporterTest {

    @Test public void testUpdateAssignment() {
        OutputStream stream = new ByteArrayOutputStream();
        AssignmentReporter reporter = new SemEvalReporter(stream);
        reporter.updateAssignment("cat", "dog.n.123", 5);
        reporter.updateAssignment("dog", "cat.v.143", 55);
        reporter.finalizeReport();

        assertEquals("dog.n dog.n.123 dog.n.5\ncat.v cat.v.143 cat.v.55\n",
                     stream.toString());
    }
View Full Code Here

                     stream.toString());
    }

    @Test public void testAssignContextToKey() {
        OutputStream stream = new ByteArrayOutputStream();
        AssignmentReporter reporter = new SemEvalReporter(stream);

        reporter.assignContextToKey("cat", "cat.n.1", 1);
        reporter.assignContextToKey("cat", "cat.n", 0);

        String[] expected = new String[] {"cat.n", "cat.n.1"};
        String[] computed = reporter.contextLabels("cat");
        assertEquals(expected.length, computed.length);
        for (int i = 0; i < expected.length; ++i)
            assertEquals(expected[i], computed[i]);
    }
View Full Code Here

TOP

Related Classes of edu.ucla.sspace.wordsi.AssignmentReporter

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.