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

Re-implement python client #65

Merged
merged 4 commits into from
Dec 29, 2020
Merged

Re-implement python client #65

merged 4 commits into from
Dec 29, 2020

Conversation

blackblitz
Copy link
Contributor

This re-implementation makes the following improvements:

  • No dependency on third-party libraries (previously required numpy but now uses array in the standard library)
  • Improvements on space efficiency
    • State lookup using bisection search on a lexicographically ordered string (previously used a dictionary)
    • Lazy evaluation of Zawgyi probability
  • More stable sigmoid-of-negative function (previously overflowed when passing large positive numbers to exp, which happens with very long Myanmar Unicode input strings)
  • Type hints (the src directory is type-checked with mypy in strict mode)
  • More concise docstrings as a result of type hints

@google-cla

This comment has been minimized.

@blackblitz
Copy link
Contributor Author

@googlebot I fixed it.

@google-cla

This comment has been minimized.

Copy link
Collaborator

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Travis CI isn't setting commit statuses right now; while we set up an alternative, please check the build status manually:

https://travis-ci.org/github/google/myanmar-tools

There is a build error in the Python build. Can you take a look? Thanks.

clients/python/src/myanmartools/__init__.py Show resolved Hide resolved
clients/python/src/myanmartools/_params.py Show resolved Hide resolved
Copy link
Collaborator

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. This is a good change because it eliminates the numpy dependency. CC @blackblitz, original author of this code; WDYT?

@blackblitz
Copy link
Contributor Author

Thanks for the changes. This is a good change because it eliminates the numpy dependency. CC @blackblitz, original author of this code; WDYT?

I think it is good. In case you didn't notice, the author of this PR and the original author of the code are the same person.

@sffc
Copy link
Collaborator

sffc commented Dec 29, 2020

Great! Let's merge it then. We should release this as version 1.2.1 on PyPI. I will make a PR to bump the version number.

@sffc sffc merged commit 92a7052 into google:master Dec 29, 2020
@sffc
Copy link
Collaborator

sffc commented Dec 29, 2020

I bumped and tagged the new version directly on the master branch:

https://github.com/google/myanmar-tools/releases/tag/v1.2.1%2Bpy

Uploaded to PyPI:

https://pypi.org/manage/project/myanmartools/release/1.2.1/

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.

None yet

2 participants