Skip to content
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

Make lowercasing by Normalizer optional #84

Merged
merged 3 commits into from
Jan 19, 2018
Merged

Make lowercasing by Normalizer optional #84

merged 3 commits into from
Jan 19, 2018

Conversation

lambdaofgod
Copy link
Contributor

Description

I've noted that Normalizer lowercases all tokens that are fed into it. I added lowercase parameter that, when set to false, doesn't lowercase tokens. By default it's true so it behaves like previous version.

Motivation and Context

It seems it could be advantageous to not lowercase some inputs (for example if someone wanted to feed output of SparkNLP pipeline to some other algorithms that are case-sensitive).

How Has This Been Tested?

I've checked old tests for Normalizer and they still work, and I added tests for lowercase = true.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Code improvements with no or little impact
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING page.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@lambdaofgod
Copy link
Contributor Author

Should I make this PR to master or tokenizer-normalizer-params? I thought about the latter, but since it wasn't updated for a bit it looked like I'd change over 100 files

@saif-ellafi
Copy link
Contributor

Looks good. I will test it shortly. Thank you for your contribution. Looking for more!

@saif-ellafi
Copy link
Contributor

I am thinking of how else the Normalizer could be improved... maybe standardizing dates? (perhaps using date matcher), clearing up some abbreviations (Sentence detector has some regex work with abbreviations) or something else..

@saif-ellafi saif-ellafi merged commit f425d84 into JohnSnowLabs:master Jan 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants