MCPcopy Create free account
hub / github.com/awslabs/gap-text2sql / __init__

Method __init__

rat-sql-gap/seq2struct/resources/corenlp.py:8–20  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6
7class CoreNLP:
8 def __init__(self):
9 if not os.environ.get('CORENLP_HOME'):
10 os.environ['CORENLP_HOME'] = os.path.abspath(
11 os.path.join(
12 os.path.dirname(__file__),
13 '../../third_party/stanford-corenlp-full-2018-10-05'))
14 if not os.path.exists(os.environ['CORENLP_HOME']):
15 raise Exception(
16 '''Please install Stanford CoreNLP and put it at {}.
17
18 Direct URL: http://nlp.stanford.edu/software/stanford-corenlp-full-2018-10-05.zip
19 Landing page: https://stanfordnlp.github.io/CoreNLP/'''.format(os.environ['CORENLP_HOME']))
20 self.client = corenlp.CoreNLPClient(endpoint="http://localhost:8999")
21
22 def __del__(self):
23 self.client.stop()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected