"[SOLVED] java.lang.nullPointerException in simple text mining script"

wmarellawmarella MemberPosts:5Contributor II
edited June 2019 inHelp
Hello, I'm new to text mining and rapidminer, but I'm following a tutorial in "Practical Text Mining" and cant make a very simple script work. The process fails and returns the java.lang.nullpointerexception error. I'm running Mac OsX 10.6.8, Java 13.7.2, Rapidminer 5.2.006.

I'm using the Read Excel operator to load a simple three-column spreadsheet. The columns are ID, Year, and Abstract. Abstract contains the text I'm trying to mine. I've flagged ID as the id field, and Abstract is flagged as text on the import wizard. There are 901 examples in the example set, and the Read Excel operator is working because I see my data when hovering over the output node. It also looks correct going into the Process Document from Data (PDFD) operator at the exa node.

On the PDFD operator, create word vector is checked (TF-IDF), as is keep text. PDFD contains a subprocess: Transform Case and Tokenize. I've removed all other operators from the program in order to isolate PDFD as the problem. When I hover over the output node of PDFD, it says Examples=0 but still shows my 3 attribute names.

Here is the xml code:



















<参数键= value =“imported_cell_range A1: E902"/>



























<参数键= " prune_below_rank " value = " 0.05 " / >



































































Here is the stack trace:

Stack trace:
------------

Exception: java.lang.NullPointerException
Message: null
Stack trace:
com.rapidminer.operator.nio.model.ExcelResultSetConfiguration.makeDataResultSet(ExcelResultSetConfiguration.java:275)
com.rapidminer.operator.nio.model.AbstractDataResultSetReader.createExampleSet(AbstractDataResultSetReader.java:127)
com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:52)
com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:36)
com.rapidminer.operator.io.AbstractReader.doWork(AbstractReader.java:123)
com.rapidminer.operator.Operator.execute(Operator.java:834)
com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:51)
com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:711)
com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:379)
com.rapidminer.operator.Operator.execute(Operator.java:834)
com.rapidminer.Process.run(Process.java:925)
com.rapidminer.Process.run(Process.java:848)
com.rapidminer.Process.run(Process.java:807)
com.rapidminer.Process.run(Process.java:802)
com.rapidminer.Process.run(Process.java:792)
com.rapidminer.gui.ProcessThread.run(ProcessThread.java:63)
Thanks in advance for any help you can offer!

Bill

Answers

  • wmarellawmarella MemberPosts:5Contributor II
    I dont know why this should matter, but I fixed this problem simply by deleting the header row in my source Excel file. I discovered this by trying to determine whether the problem was with my data or whether the code for this operator was bad. So I made a simple 4-example set in Excel and by chance didnt bother labeling the columns. Everything imported fine and the Process Documents operator produced the text vector. So I tried this on my real 901- example file and it too worked fine. I'll leave it to the developers to see if this is a bug associated with this operator not being able to handle labels in the first row for some reason.
  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University ProfessorPosts:1,984RM Engineering
    Hi,

    there was indeed a bug involved, should be fixed in the next release.

    Regards,
    Marco
  • balmerhevibalmerhevi MemberPosts:2Contributor I

    NullPointerException is aRuntimeException。运行时异常,不能ca至关重要ught at compile time. They crash the program at run time if they are not handled properly. When a class is instantiated, its object is stored in computer memory. TheNullPointerExceptionsoccur when you try to use a reference that points to no location in memory (null) as though it were referencing an object. These include:

    1. Calling the instance method of a null object.
    2. Accessing or modifying the field of a null object.
    3. Throwing null as if it were a Throwable value.

    Balmer

  • magui_taillefermagui_taillefer MemberPosts:1Contributor I

    I had the same problem (RapidMiner 6.5.2). Because I use some attributes and it's confusing to have no names, I just tried to import csv excelsheets and it works (slowly) but without errors.

    Cheers,

    ME. Taillefer

    Thomas_Ott
Sign InorRegisterto comment.