Document name in id2outcome file

10 views
Skip to first unread message

lakhani...@gmail.com

unread,
Jul 26, 2016, 3:42:14 PM7/26/16
to dkpro-tc-users
Hello Dear people,
I am using multilabel classification and generating report.
In the file id2outcome.txt file, I am getting document and id and scores per class.
I want to have document name instead of id in id2outcome file.
Can somebody tell me how I can get that?

Thank you in advance

Emily Jamison

unread,
Jul 27, 2016, 11:30:48 AM7/27/16
to lakhani...@gmail.com, dkpro-tc-users
Hi,

I took a brief look at the pipeline for multi-label document-mode instance ids.  For sequence classification, there is a method, TextClassificationTarget.setSuffix(String aSuffix) that can be used in the Reader, to add a string suffix to the unit id as printed in the id2outcome file.  (This method is currently nonfunctional for some of the OutcomeId reports, and needs a bug report, but the functionality exists up until the OutcomeId report.)

I didn't find any similar method for document-mode classification, so I suggest altering getFullId(JCas jcas) in org.dkpro.tc.core.feature.InstanceIdFeature as follows:

    private static String getFullId(JCas jcas)
        throws TextClassificationException
    {
        JCasId jcasId = JCasUtil.selectSingle(jcas, JCasId.class);
        DocumentMetaData dmd = DocumentMetaData.get(jcas);
        String documentName = dmd.getDocumentId();
        return "" + jcasId.getId() + "-" + documentName;
    }

I ran it on org.dkpro.tc.examples.multi.document.MekaComplexConfigurationMultiDemo, and the id2outcome files show filenames.

Best,
Emily


--
You received this message because you are subscribed to the Google Groups "dkpro-tc-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dkpro-tc-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lakhani...@gmail.com

unread,
Jul 29, 2016, 7:17:56 AM7/29/16
to dkpro-tc-users, lakhani...@gmail.com
Thank you Emily,
It worked.
I have another question.
Can we get accuracy, precision, Recall etc. without storing them in file.
Right now they are in excel file, which is unable to read using java.
I have to show those results other than excel file.

Emily Jamison

unread,
Jul 30, 2016, 1:51:57 PM7/30/16
to Vishal Lakhani, dkpro-tc-users
Perhaps org.dkpro.tc.evaluation.Id2Outcome, and the dkpro-tc-evaluation module in general, have what you need?

-- Emily
Reply all
Reply to author
Forward
0 new messages