mmxgn / miniepy Goto Github PK
View Code? Open in Web Editor NEWThis project forked from uma-pi1/minie
Open Information Extraction system - Python wrapper
License: GNU General Public License v3.0
This project forked from uma-pi1/minie
Open Information Extraction system - Python wrapper
License: GNU General Public License v3.0
As written in the readme, I was compiling MinIE using maven 3.8.5
. However, I was getting the following error:
[ERROR] Failed to execute goal on project minie: Could not resolve dependencies for project de.uni_mannheim:minie:jar:0.0.1-SNAPSHOT: Could not transfer artifact edu.stanford.nlp:stanford-corenlp:jar:models:3.8.0 from/to central (https://repo.maven.apache.org/maven2): GET request of: edu/stanford/nlp/stanford-corenlp/3.8.0/stanford-corenlp-3.8.0-models.jar from central failed: Premature end of Content-Length delimited message body (expected: 362,452,284; received: 18,865,505) -> [Help 1]
Could you please help me resolve this issue?
Hello, this is the error I am getting, it seems that it is able to get the references with the autoclass
but cannot create the object after getting the reference. I might be totally wrong too but do you know what might be the reason here?
I built the minIE jar and have my CLASSPATH
set before importing the autoclass
too
triples = [p.triple for p in minie.get_propositions(sentence)] -> Line that causes the error in the miniepy.py
self.minie_obj = MinIE(String(sentence), self.parser, nmode) -> Constructor for the java object
File "jnius/jnius_export_class.pxi", line 270, in jnius.JavaClass.__init__
File "jnius/jnius_export_class.pxi", line 340, in jnius.JavaClass.call_constructor
jnius.JavaException: No constructor matching your arguments, available:
['(Ljava/lang/String;Ledu/stanford/nlp/pipeline/StanfordCoreNLP;Lde/uni_mannheim/minie/MinIE$Mode;)V', '(Ljava/lang/String;Ledu/stanford/nlp/pipeline/StanfordCoreNLP;Lde/uni_mannheim/minie/MinIE$Mode;Lde/uni_mannheim/utils/Dictionary;)V', '()V', '(Lit/unimi/dsi/fastutil/objects/ObjectArrayList;)V', '(Ljava/lang/String;Ledu/stanford/nlp/semgraph/SemanticGraph;Lde/uni_mannheim/minie/MinIE$Mode;)V', '(Ljava/lang/String;Ledu/stanford/nlp/semgraph/SemanticGraph;Lde/uni_mannheim/minie/MinIE$Mode;Lde/uni_mannheim/utils/Dictionary;)V']
Also thank you for the work of creating this.
Hi, thank you for sharing your code!
I implemented Miniepy as it was recommended in the README, but when I run "python3 demo.py" I get the following error message:
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> SLF4J: Defaulting to no-operation (NOP) logger implementation
> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
I tried different methods that were suggested on the internet to resolve the issue, but the error message is still there. It does make the extractions tho.
Are the extractions affected by this? Is there a way to resolve this?
Thank you very much in advance!
Hey @mmxgn,
first of all, thanks for sharing this!
I followed the setup you described., then, when I want to run the bindings as well as the demo.py.
Unfortunately when i try to run demo.py I get:
Traceback (most recent call last):
File "demo.py", line 31, in <module>
parser = CoreNLPUtils.StanfordDepNNParser()
File "jnius/jnius_export_class.pxi", line 856, in jnius.JavaMethod.__call__
File "jnius/jnius_export_class.pxi", line 1028, in jnius.JavaMethod.call_staticmethod
File "jnius/jnius_jvm_dlopen.pxi", line 91, in jnius.create_jnienv
jnius.JavaException: JVM exception occurred: Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl edu.stanford.nlp.util.ReflectionLoading$ReflectionLoadingException
In the case of using the bindings:
jar_file = "absolute/path/to/.jar"
minie = MinIE(jar_file)
# Sentence to extract triples from
sentence = "The Joker believes that the hero Batman was not actually born in foggy Gotham City."
triples = [p.triple for p in minie.get_propositions(sentence)]
TypeError: init() takes 1 positional argument but 2 were given
If i remove the jar_file from the constructor:
---> 46 CoreNLPUtils = autoclass('de.uni_mannheim.utils.coreNLP.CoreNLPUtils')
47
48 # Dependency parsing pipeline initialization
~/opt/anaconda3/lib/python3.8/site-packages/jnius/reflect.py in autoclass(clsname, include_protected, include_private)
227
228 # c = Class.forName(clsname)
--> 229 c = find_javaclass(clsname)
230 if c is None:
231 raise Exception('Java class {0} not found'.format(c))
jnius/jnius_export_func.pxi in jnius.find_javaclass()
jnius/jnius_jvm_dlopen.pxi in jnius.create_jnienv()
JavaException: JVM exception occurred: de/uni_mannheim/utils/coreNLP/CoreNLPUtils java.lang.NoClassDefFoundError
Do you know what goes wrong or how to fix it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.