opencog / relex

English Dependency Relationship Extractor
http://wiki.opencog.org/w/RelEx
Apache License 2.0
85 stars 69 forks source link

Relex build fails with link-grammar version 5.7.0 #283

Closed vsbogd closed 5 years ago

vsbogd commented 5 years ago

Unit tests fail (see the log below) because LinkGrammar.getLinkageSense and LinkGrammar.getLinkageSenseScore java API method implementations were removed by commit https://github.com/opencog/link-grammar/commit/5249ddb99fb8fd33731b518029c31f316c1c552c#diff-acf5e8f599bb0954fb0aa69ba6293ce1

The error cannot be found at the compilation stage because Java API still contains the methods declarations: https://github.com/opencog/link-grammar/blob/c304c4398557b8849da42e5a40c72cdb13db0758/bindings/java/org/linkgrammar/LinkGrammar.java#L120-L122

Build log:

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.387 s <<< FAILURE! - in relex.test.TestRelEx
[ERROR] runTests(relex.test.TestRelEx)  Time elapsed: 5.273 s  <<< ERROR!
java.lang.UnsatisfiedLinkError: org.linkgrammar.LinkGrammar.getLinkageSense(II)Ljava/lang/String;
    at relex.test.TestRelEx.test_sentence(TestRelEx.java:75)
    at relex.test.TestRelEx.test_determiners(TestRelEx.java:161)
    at relex.test.TestRelEx.runTests(TestRelEx.java:1981)

[INFO] Running relex.test.TestStanford
Info: Loading resource file_properties.xml from jar.
Info: Loading resource relex-tagging.algs from jar.
Info: Loading resource relex-semantic.algs from jar.
Info: Loading resource relex-penn-tagging.algs from jar.
Info: Loading resource relex-stanford.algs from jar.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.06 s <<< FAILURE! - in relex.test.TestStanford
[ERROR] runTests(relex.test.TestStanford)  Time elapsed: 0.06 s  <<< ERROR!
java.lang.UnsatisfiedLinkError: org.linkgrammar.LinkGrammar.getLinkageSense(II)Ljava/lang/String;
    at relex.test.TestStanford.test_sentence(TestStanford.java:72)
    at relex.test.TestStanford.runTests(TestStanford.java:161)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   TestRelEx.runTests:1981->test_determiners:161->test_sentence:75 » UnsatisfiedLink
[ERROR]   TestStanford.runTests:161->test_sentence:72 » UnsatisfiedLink org.linkgrammar....
[INFO] 
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40.968 s
[INFO] Finished at: 2019-09-19T14:05:55+00:00
[INFO] Final Memory: 22M/73M
[INFO] ------------------------------------------------------------------------
vsbogd commented 5 years ago

@linas, fast look shows that this functionality is used iff storeSense option is enabled in LGConfig. And it in turn is enabled by do_apply_algs flag: https://github.com/opencog/relex/blob/2f71dc0f62a83d59ec3677d2c64a7b77813b93af/src/java/relex/RelationExtractor.java#L155-L159 which is true by default: https://github.com/opencog/relex/blob/2f71dc0f62a83d59ec3677d2c64a7b77813b93af/src/java/relex/RelationExtractor.java#L114-L127

So it looks like removing this method is breaking change for Relex.

linas commented 5 years ago

the sense stuff should be stripped out of relex. It has not worked in .. a decade?

linas commented 5 years ago

someone removed build.xml from relex, making it impossible to build, without having to install maven. wtf.

We need to figure out how to stop using relex.

linas commented 5 years ago

I removed that one line with pull req #285 -- and merged it. Tests now build, for me. Tested with ant -- re-open or open a new bug if it doesn't work with maven.

linas commented 5 years ago

Oh. looks like there's more to be done. another pull req will follow shortly...

linas commented 5 years ago

Pull req #286 removes the rest. Oddly enough, I did not get any errors when this was accidentally left in...

vsbogd commented 5 years ago

Thanks!