adsense728x90


Question Answering PPP-QuestionParsing-Grammatical 실행해보기 AI

Open source Question answering framework

PPP-QuestionParsing-Grammatical

Question Parsing module for the PPP using a grammatical approch

Updated on Mar 29




설치하려고 시도하는데, 잘 안 되네.

virtualenv python=python3.5 pvenv
source pvenv/bin/activate

pip3 install git+https://github.com/ProjetPP/PPP-QuestionParsing-Grammatical.git



Ppp/PPP-QuestionParsing-Grammatical/demo$ python demo1.py 
Traceback (most recent call last):
  File "demo1.py", line 1, in <module>
    from corenlp import StanfordCoreNLP
ImportError: No module named 'corenlp'


pip install corenlp-python
설치한다.


You can install the main dependencies (especially CoreNLP) using the script file bootstrap_corenlp.sh fromhttps://github.com/ProjetPP/Scripts (clone the Scripts repository and run bash bootstrap_corenlp.sh).

라는데, Scripts repository에는 bootstrap_corenlp.sh가 없다.

에 설명이 있었다.

CORENLP="stanford-corenlp-full-2015-01-30" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python3 -m corenlp



demo를 실행시켜 보기 위해서
https://github.com/ProjetPP/PPP-QuestionParsing-Grammatical.git
를 git clone.

sibling으로 

/Scripts

도 git clone

stanford-corenlp-full-2015-01-30 를 받고 싶은데, 아직 못 찾겠다.

cd Scripts
wget http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip

CORENLP="stanford-corenlp-full-*" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python -m corenlp -H 0.0.0.0 -p 

8080 port로 실행 된다.

다른 terminal에서 source pvenv/bin/activate 하고
cd PPP-QuestionParsing-Grammatical/demo

corenlp directory나 port를 조금씩 고쳐가면서 demo1부터 실행.

python demo1.python 은 실행 됐다.

demo3.python에서 port를 8080로 고치기.

demo3가 json error가 나는 중. -_-

PPP-QuestionParsing-Grammatical/demo$ python3 demo3.py > demo.dot
Where is the capital of Belgium?
Traceback (most recent call last):
  File "demo3.py", line 29, in <module>
    print(get_tree())
  File "demo3.py", line 24, in get_tree
    result = nlp.parse(sentence)
  File "demo3.py", line 17, in parse
    result = r.json()['sentences'][0]
.../site-packages/requests/models.py", line 826, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

127.0.0.1 - - [23/Aug/2016 00:15:13] "POST /?properties=%7B%22annotators%22%3A+%22tokenize%2Cssplit%2Cpos%2Clemma%2Cner%2Cparse%22%2C+%22outputFormat%22%3A+%22json%22%2C+%22parse.flags%22%3A+%22+-makeCopulaHead%22%7D HTTP/1.1" 404 -


$ pip install jsonrpclib

했더니, 이제는 corenlp도 안 뜬다.

Ppp/Scripts$ CORENLP="stanford-corenlp-full-2014-08-27" CORENLP_OPTIONS="-parse.flags \" -makeCopulaHead\"" python3 -m corenlp -p 9000
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)

    from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
ImportError: No module named 'jsonrpclib'







을 보면,

git clone https://bitbucket.org/ProgVal/corenlp-python.git


을 썼었나 보다.



덧글

댓글 입력 영역