multi-label classification / features / LuceneNGram

20 views
Skip to first unread message

cherep...@googlemail.com

unread,
Jan 17, 2017, 2:57:25 PM1/17/17
to dkpro-tc-users
Hello,

I could not comprehend why LuceneNGram.class as feature is necessary in your demo examples (MekaReutersDemoSimpleDkproReader, MekaSaveAndApplyModelMultilabelDemo).
And what do I have to do if I don't want to use LuceneNGram.class as feature?

best regards

Johannes Daxenberger

unread,
Jan 18, 2017, 7:12:55 AM1/18/17
to cherep...@googlemail.com, dkpro-tc-users
Hi,

what do you mean with “necessary”? The LuceneNGram feature is not strictly necessary, but it makes sense to include it (it extract ngrams – uni-, bi, and trigrams).
If you don’t want to use a feature, just delete the respective TcFeatureFactory.create(FEATURE_NAME.class, …) – e.g. lines 111ff in the latest version of MekaReutersDemoSimpleDkproReader.

Best,
Johannes

Am 17.01.17, 20:57 schrieb "cherepanov.ic via dkpro-tc-users" <dkpro-t...@googlegroups.com>:
--
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.


Igor Cherepanov

unread,
Jan 18, 2017, 7:50:02 AM1/18/17
to Johannes Daxenberger, dkpro-tc-users
after deleting or replacing of this feature I get following Exceptions:


Exception in thread "main" org.dkpro.lab.engine.ExecutionException: org.dkpro.lab.engine.ExecutionException: java.lang.NullPointerException
at org.dkpro.lab.engine.impl.BatchTaskEngine.run(BatchTaskEngine.java:155)
at org.dkpro.lab.engine.impl.DefaultTaskExecutionService.run(DefaultTaskExecutionService.java:52)
at org.dkpro.lab.Lab.run(Lab.java:113)
at tutorial5.MekaReutersDemoSimpleDkproReader.runTrainTest(MekaReutersDemoSimpleDkproReader.java:144)
at tutorial5.MekaReutersDemoSimpleDkproReader.main(MekaReutersDemoSimpleDkproReader.java:81)
Caused by: org.dkpro.lab.engine.ExecutionException: java.lang.NullPointerException
at org.dkpro.lab.engine.impl.ExecutableTaskEngine.run(ExecutableTaskEngine.java:68)
at org.dkpro.lab.engine.impl.BatchTaskEngine.runNewExecution(BatchTaskEngine.java:341)
at org.dkpro.lab.engine.impl.BatchTaskEngine.executeConfiguration(BatchTaskEngine.java:235)
at org.dkpro.lab.engine.impl.BatchTaskEngine.run(BatchTaskEngine.java:133)
... 4 more
Caused by: java.lang.NullPointerException
at weka.filters.Filter.useFilter(Filter.java:665)
at org.dkpro.tc.ml.weka.util.WekaUtils.applyAttributeSelectionFilter(WekaUtils.java:936)
at org.dkpro.tc.ml.weka.task.WekaTestTask.execute(WekaTestTask.java:118)
at org.dkpro.lab.engine.impl.ExecutableTaskEngine.run(ExecutableTaskEngine.java:55)
... 7 more

2017-01-18 13:12 GMT+01:00 Johannes Daxenberger <daxen...@ukp.informatik.tu-darmstadt.de>:
Hi,

what do you mean with “necessary”? The LuceneNGram feature is not strictly necessary, but it makes sense to include it (it extract ngrams – uni-, bi, and trigrams).
If you don’t want to use a feature, just delete the respective TcFeatureFactory.create(FEATURE_NAME.class, …) – e.g. lines 111ff in the latest version of MekaReutersDemoSimpleDkproReader.

Best,
Johannes

Am 17.01.17, 20:57 schrieb "cherepanov.ic via dkpro-tc-users" <dkpro-tc-users@googlegroups.com>:


    Hello,

    I could not comprehend why LuceneNGram.class as feature is necessary in your demo examples (MekaReutersDemoSimpleDkproReader, MekaSaveAndApplyModelMultilabelDemo).
    And what do I have to do if I don't want to use LuceneNGram.class as feature?

    best regards

    --
    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-users+unsubscribe@googlegroups.com.

Johannes Daxenberger

unread,
Jan 18, 2017, 8:40:54 AM1/18/17
to Igor Cherepanov, dkpro-tc-users

Hi,

 

thanks for spotting this. The NPE was indeed thrown erroneous here. Reason: feature selection was activated (dimFeatureSelection), but after deleting ngrams fewer features than the filter should keep were available.

This of course shouldn’t result in an exception. Already provided committed a fix.

 

Best,

Johannes

Am 17.01.17, 20:57 schrieb "cherepanov.ic via dkpro-tc-users" <dkpro-t...@googlegroups.com>:



    Hello,

    I could not comprehend why LuceneNGram.class as feature is necessary in your demo examples (MekaReutersDemoSimpleDkproReader, MekaSaveAndApplyModelMultilabelDemo).
    And what do I have to do if I don't want to use LuceneNGram.class as feature?

    best regards

    --
    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.

Igor Cherepanov

unread,
Jan 18, 2017, 12:41:14 PM1/18/17
to Johannes Daxenberger, dkpro-tc-users
thanks! it works finally 

2017-01-18 14:40 GMT+01:00 Johannes Daxenberger <daxen...@ukp.informatik.tu-darmstadt.de>:

Hi,

 

thanks for spotting this. The NPE was indeed thrown erroneous here. Reason: feature selection was activated (dimFeatureSelection), but after deleting ngrams fewer features than the filter should keep were available.

Am 17.01.17, 20:57 schrieb "cherepanov.ic via dkpro-tc-users" <dkpro-tc-users@googlegroups.com>:



    Hello,

    I could not comprehend why LuceneNGram.class as feature is necessary in your demo examples (MekaReutersDemoSimpleDkproReader, MekaSaveAndApplyModelMultilabelDemo).
    And what do I have to do if I don't want to use LuceneNGram.class as feature?

    best regards

    --
    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-users+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages