New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DependencyGraph or Stanford Parser API issues with sentences with "/" #1510
Comments
Hi @alvations Any updates on this? |
I can have a look, somehow I've missed this issue. |
@tesslocl what's your sentence? Did you try to use CoreNLP (nltk/parse/corenlp.py) instead? |
You need to start a cornlp server, try: with CoreNLPServer(port=9000) as server:
parser = CoreNLPParser(url=server.url)
parser.parse(...) I'm sorry for the missing documentation, and for a shirt reply, as I'm typing on my phone. |
you can try other port: CoreNLPServer(port=9001), for example or just CoreNLPServer() then a free port should be chosen. |
Do you have corenlp .jars? You need to have a corenlp server running locally. Can you run this example #1249 (review) |
Once you've started the server, can you access http://localhost:9000 in your browser? You can also start the server by yourself, refer to https://stanfordnlp.github.io/CoreNLP/corenlp-server.html One it's running, and you can access it via the browser, you should be able to use the parser: parser = CoreNLPParser(url='http://localhost:9000')
# and so on |
Are you able to start a corenlp server from a terminal (not from python), check https://stanfordnlp.github.io/CoreNLP/corenlp-server.html for more details?
|
Ok, there are two steps involved:
The error messages you post suggest that the CoreNLP Java server is not running. |
Did you try it with |
Hi there, seems that I also encountered with this problem. My sentence is: |
@caisinong have you tried using the new CoreNLP interface? See my comments above. |
Once you've started a server manually, you don't need to start server in the code. Keep the server running and instantiate the parser: parser = CoreNLPParser(url='http://localhost:9000') |
I have similar experience. Starting the Stanford CorenNLP server in the code is messy and should only be used for testing purposes. Maybe we should somehow not expose that to the user. |
I'm glad that things are working. Indeed, the server should be started outside of Python code. |
Patched and resolved by new CoreNLP API =) |
@dimazest Hi... if the text contains |
@kavin26 Yes, please use the |
@alvations thank you so much 👍 |
A user has reported that this sentence throws and
AssertionError
when using Stanford'sDependencyParser
API in NLTK for this sentence:Code:
Possibly, it might be how
DependencyGraph
is reading the output or that the Stanford output is inconsistent.More details on the setup for NLTK + Stanford tools is on https://gist.github.com/alvations/e1df0ba227e542955a8a#stanford-parser
The text was updated successfully, but these errors were encountered: