Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
removed setting CLASSPATH in the python scripts, I don't understand w…
Browse files Browse the repository at this point in the history
…hy I thought this might be a good idea
  • Loading branch information
mmxgn committed Sep 15, 2018
1 parent b07f716 commit 54b3c10
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/main/python/miniepy/miniepy.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,12 @@ def triple(self):
for n in range(self.java_obj.triple.size())])

class MinIE:
def __init__(self,
jar_file = None,
java_home = None,
):
if java_home:
os.environ['JAVA_HOME'] = java_home

if jar_file:
if 'CLASSPATH' in os.environ:
os.environ['CLASSPATH'] = "{}:{}".format(jar_file,
os.environ['CLASSPATH'])
else:
os.environ['CLASSPATH'] = jar_file
def __init__(self):


# Import jnius.autoclass after modifying CLASSPATH
from jnius import autoclass
MinIE.autoclass = autoclass

CoreNLPUtils = autoclass('de.uni_mannheim.utils.coreNLP.CoreNLPUtils')

Expand Down Expand Up @@ -82,13 +75,14 @@ def get_propositions(self,sentence, mode = 'SAFE'):


if __name__ == "__main__":

sentence = 'The Joker believes that the hero Batman was not actually born in foggy Gotham City.'
print("Original sentence:")
print('\t{}'.format(sentence))
# Extract triples

# Get MinIE instance
minie = MinIE(jar_file='../../../../target/minie-0.0.1-SNAPSHOT.jar')
minie = MinIE()

# Get proposition triples
triples = [p.triple for p in minie.get_propositions(sentence)]
Expand Down

0 comments on commit 54b3c10

Please sign in to comment.