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
Allowed properties overloading for CoreNLPParser tag, Authors.md #2789
base: develop
Are you sure you want to change the base?
Conversation
For those interested in the reasoning behind the changes in this PR, feel free to have a look at #2112 itself, where all the changes are already described and laid out. |
@@ -339,9 +339,11 @@ def tag_sents(self, sentences): | |||
""" | |||
# Converting list(list(str)) -> list(str) | |||
sentences = (" ".join(words) for words in sentences) | |||
return [sentences[0] for sentences in self.raw_tag_sents(sentences)] | |||
if properties is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a description for the properties
argument in the docstring, also mention that "tokenize.whitespace"
is set to True
by default (but it won't if properties
are specified.
would it be possible to make a test out of this example? |
Sure , bit busy, will add over weekend |
@tomaarsen @dimazest |
you should be able to manually use CoreNLP Rest API and intercept returned result |
Keep in mind that the CoreNLP tests are being skipped, because our GitHub Actions CI doesn't currently support downloading third party tools such as the Stanford models. Preferably we would still have tests for this PR though, as we likely want to support third party tools eventually. |
The actual call to corenlp should be mock, then tests won't need corenlp running. |
Since #2820 there are automated tests for CoreNLP. We would like to see some tests to back up these changes, is possible. |
@@ -339,9 +339,11 @@ def tag_sents(self, sentences): | |||
""" | |||
# Converting list(list(str)) -> list(str) | |||
sentences = (" ".join(words) for words in sentences) | |||
return [sentences[0] for sentences in self.raw_tag_sents(sentences)] | |||
if properties is None: | |||
properties = {"tokenize.whitespace": "true"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged develop into this PR. Because the CoreNLP tests now run on the CI, we can see that some tests fail due to this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomaarsen apart from automated tests for CoreNLP is there any other test that needs to be added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR should have some tests that show that the new behaviour works like intended, so you would only need to add tests for the functionality that you added. So, just for these functions.
@BatMrE: just wondering if there's interest in wrapping this up. I think it's just a question of adding a test or two. |
This is a fix to #2112
Added the overloading properties in code as per the standards
before fix : [('my', 'O'), ('phone', 'O'), ('number', 'O'), ('is', 'O'), ('1111\xa01111\xa01111', 'O')]
after fix : [('my', 'O'), ('phone', 'O'), ('number', 'O'), ('is', 'O'), ('1111', 'DATE'), ('1111', 'DATE'), ('1111', 'DATE')]