Package etc.aloe.data

Examples of etc.aloe.data.Message


                });

        segments = new SegmentSet();

        Segment seg0 = new Segment();
        seg0.add(new Message(0, new Date(), "Alice", "it's"));
        seg0.add(new Message(1, new Date(), "Bob", "cow"));
        seg0.add(new Message(2, new Date(), "Alice", "time"));
        seg0.setTrueLabel(Boolean.TRUE);
        segments.add(seg0);

        Segment seg1 = new Segment();
        seg1.add(new Message(3, new Date(), "Bob", "noooooooo"));
        seg1.setTrueLabel(Boolean.FALSE);
        segments.add(seg1);

        Segment seg2 = new Segment();
        seg2.add(new Message(4, new Date(), "Bob", "once"));
        seg2.add(new Message(5, new Date(), "Alice", "upon"));
        seg2.setTrueLabel(Boolean.FALSE);
        segments.add(seg2);

        basicExamples = segments.getBasicExamples();
    }
View Full Code Here


     */
    @Test
    public void testResolveLabel_AllNegative() {
        System.out.println("resolveLabel_AllNegative");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", Boolean.FALSE));
        segment.add(new Message(2, new Date(), "Bob", "Hello", Boolean.FALSE));
        segment.add(new Message(3, new Date(), "Alice", "How are you", Boolean.FALSE));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", Boolean.FALSE));
        segment.add(new Message(5, new Date(), "Alice", "Yay", Boolean.FALSE));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = Boolean.FALSE;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

     */
    @Test
    public void testResolveLabel_AllPositive() {
        System.out.println("resolveLabel_AllPositive");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", Boolean.TRUE));
        segment.add(new Message(2, new Date(), "Bob", "Hello", Boolean.TRUE));
        segment.add(new Message(3, new Date(), "Alice", "How are you", Boolean.TRUE));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", Boolean.TRUE));
        segment.add(new Message(5, new Date(), "Alice", "Yay", Boolean.TRUE));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = Boolean.TRUE;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

     */
    @Test
    public void testResolveLabel_OnePositive() {
        System.out.println("resolveLabel_OnePositive");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", Boolean.FALSE));
        segment.add(new Message(2, new Date(), "Bob", "Hello", Boolean.TRUE));
        segment.add(new Message(3, new Date(), "Alice", "How are you", Boolean.FALSE));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", Boolean.FALSE));
        segment.add(new Message(5, new Date(), "Alice", "Yay", Boolean.FALSE));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = Boolean.TRUE;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

     */
    @Test
    public void testResolveLabel_OneNegative() {
        System.out.println("resolveLabel_OneNegative");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", Boolean.TRUE));
        segment.add(new Message(2, new Date(), "Bob", "Hello", Boolean.TRUE));
        segment.add(new Message(3, new Date(), "Alice", "How are you", Boolean.TRUE));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", Boolean.FALSE));
        segment.add(new Message(5, new Date(), "Alice", "Yay", Boolean.TRUE));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = Boolean.TRUE;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

     */
    @Test
    public void testResolveLabel_Unlabeled() {
        System.out.println("resolveLabel_Unlabeled");
        Segment segment = new Segment();
        segment.add(new Message(1, new Date(), "Alice", "Hello", null));
        segment.add(new Message(2, new Date(), "Bob", "Hello", null));
        segment.add(new Message(3, new Date(), "Alice", "How are you", null));
        segment.add(new Message(4, new Date(), "Bob", "Very well thanks", null));
        segment.add(new Message(5, new Date(), "Alice", "Yay", null));

        ResolutionImpl instance = new ResolutionImpl();
        Boolean expResult = null;
        Boolean result = instance.resolveLabel(segment);
        assertEquals(expResult, result);
View Full Code Here

            String messageStr = options.messageText;
            String participant = "stdin";
            Date time = new Date();

            MessageSet messages = new MessageSet();
            Message message = new Message(0, time, participant, messageStr);
            messages.add(message);

            //Make a segment for the message
            Segment segment = new Segment();
            segment.add(message);
            SegmentSet segmentSet = new SegmentSet();
            segmentSet.add(segment);

            LabelingController labelingController = new LabelingController();
            factory.configureLabeling(labelingController);

            FeatureSpecification spec = this.loadFeatureSpecification(options.inputFeatureSpecFile);
            Model model = this.loadModel(options.inputModelFile);

            labelingController.setModel(model);
            labelingController.setFeatureSpecification(spec);
            labelingController.setSegmentSet(segmentSet);
            labelingController.run();

            System.out.println("" + message.getPredictedLabel());
        } else {
            throw new IllegalArgumentException("Options must be for Single");
        }
    }
View Full Code Here

    }

    @Before
    public void setUp() {
        this.rawMessages = new MessageSet();
        rawMessages.add(new Message(1, new Date(), "Alice", "Hello1"));
        rawMessages.add(new Message(2, new Date(), "Bob", "Hello2"));
        rawMessages.add(new Message(3, new Date(), "Alice", "Hello3"));
        rawMessages.add(new Message(4, new Date(), "Bob", "Hello4"));
        rawMessages.add(new Message(5, new Date(), "Alice", "Hello5"));
        rawMessages.add(new Message(6, new Date(), "Bob", "Hello6"));
        rawMessages.add(new Message(7, new Date(), "Alice", "Hello7"));
        rawMessages.add(new Message(8, new Date(), "Alice", "Hello8"));
        rawMessages.add(new Message(9, new Date(), "Alice", "Hello9"));
        rawMessages.add(new Message(10, new Date(), "Alice", "Hello10"));

        this.segments = new SegmentSet();
        Segment seg = new Segment();
        seg.add(rawMessages.get(0));
        this.segments.add(seg);
View Full Code Here

        System.out.println("predict");
        LabelMappingImpl instance = new LabelMappingImpl();
        instance.map(predictions, this.segments);

        for (int m = 0; m < rawMessages.size(); m++) {
            Message message = rawMessages.get(m);
            Boolean expected = messageLabels.get(m);
            Boolean actual = message.getPredictedLabel();

            assertTrue(expected == actual);
        }

    }
View Full Code Here

        long now = new Date().getTime();
        long second = 1 * 1000;
        long minute = 60 * 1000;

        messages.add(new Message(0, new Date(now), "Alice", "it's"));
        messages.add(new Message(1, new Date(now + second), "Bob", "cow"));
        messages.add(new Message(2, new Date(now + 2 * second), "Alice", "time"));
        messages.add(new Message(3, new Date(now + minute), "Bob", "noooooooo"));
        messages.add(new Message(4, new Date(now + minute + second), "Bob", "once"));
        messages.add(new Message(5, new Date(now + 2 * minute), "Alice", "upon"));
        messages.add(new Message(6, new Date(now + 3 * minute), "Bob", "a"));
        messages.add(new Message(7, new Date(now + 3 * minute + second), "Alice", "time"));

        NullSegmentation instance = new NullSegmentation();
        SegmentSet segments = instance.segment(messages);

        //Expecting the same number of segments as messages
        assertEquals(messages.size(), segments.size());

        for (int i = 0; i < messages.size(); i++) {
            Message message = messages.get(i);
            Segment segment = segments.get(i);

            assertEquals(1, segment.getMessages().size());
            assertEquals(message, segment.getMessages().get(0));
        }
View Full Code Here

TOP

Related Classes of etc.aloe.data.Message

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.