mkabbasi / cleartk

Automatically exported from code.google.com/p/cleartk
0 stars 0 forks source link

SemanticRoleLabeler model file hard-coded in cleartk-clearnlp 0.0.6 #382

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Trying to build a SemanticRoleLabeler AE will give a FileNotFoundException 
because it is hard-coded in as the sample model file in the working directory.

this.medSemLabeler = SemanticRoleLabeler.getDescription("en", 
                                                                new File ("/work/scratch/users/marisa_boston/clearnlp/models/mayo-en-pred-1.3.0.tgz").toURI(),
                                                                new File ("/work/scratch/users/marisa_boston/clearnlp/models/mayo-en-role-1.3.0.tgz").toURI(),
                                                                new File ("/work/scratch/users/marisa_boston/clearnlp/models/mayo-en-srl-1.3.0.tgz").toURI());

What is the expected output?
A working SemanticRoleLabeler.

What do you see instead?
Caused by: java.io.FileNotFoundException: 
/build/baseline/exec/src/test/resources/models/sample-en-pred-1.3.0.tgz (No 
such file or directory)

What version of the product are you using? On what operating system?
cleartk-clearnlp 0.0.6 on a Unix system (within a UIMA pipeline).

Original issue reported on code.google.com by marisa.b...@gmail.com on 19 Aug 2013 at 12:57

GoogleCodeExporter commented 8 years ago
This is indeed a bug.  The hard coded bits from what should have been in the 
parameterless SemanticRoleLabeler.getDescription() are in the parameterized 
getDescription call.

Would this get fixed as a bump on the 1.4.* branch?

Original comment by lee.becker on 19 Aug 2013 at 9:03

GoogleCodeExporter commented 8 years ago
If you want to fix this and make a 1.4.2 release, you're welcome to do so. 
There's not actually a 1.4.x branch (just a tag), so you'd want to check out 
the tag, create a branch from it, fix the bug there, and then make the release.

Alternatively, I had planned to just fix this in for the upcoming 2.0.0 release.

Note that there is a workaround:

AnalysisEngineFactory.createPrimitiveDescription(SemanticRoleLabeler.class,
      SemanticRoleLabeler_ImplBase.PARAM_LANGUAGE_CODE,
      languageCode,
      SemanticRoleLabeler_ImplBase.PARAM_PRED_ID_MODEL_URI,
      new File("/work/scratch/users/marisa_boston/clearnlp/models/mayo-en-pred-1.3.0.tgz").toURI(),
      SemanticRoleLabeler_ImplBase.PARAM_ROLESET_MODEL_URI,
      new File("/work/scratch/users/marisa_boston/clearnlp/models/mayo-en-role-1.3.0.tgz").toURI(),
      SemanticRoleLabeler_ImplBase.PARAM_SRL_MODEL_URI,
      new File("/work/scratch/users/marisa_boston/clearnlp/models/mayo-en-srl-1.3.0.tgz").toURI());

If you decide to make a 1.4.2 release, please update the milestone of this 
ticket.

Original comment by steven.b...@gmail.com on 24 Aug 2013 at 2:20

GoogleCodeExporter commented 8 years ago
By the way, "src/test/resources" should never be in anything but test code. And 
"src/main/resources" should never be in any of our production code - for that 
kind of thing, we should be using the Java resource mechanism. (That is, after 
all, why we put the files in src/main/resources.)

Original comment by steven.b...@gmail.com on 24 Aug 2013 at 2:21

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 6a579094c1db.

Original comment by steven.b...@gmail.com on 30 Oct 2013 at 10:33