-
-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ Add min_count parameter to the base_processor. * ✨ Add `disable_auto_summary` config. * ✨ Allows custom average types, logs to an array for easy access to the last epoch. * 💥 Introducing breaking changes, rename package name to kashgari. * 🔊 Adding migration guide.
- Loading branch information
Showing
13 changed files
with
190 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# encoding: utf-8 | ||
|
||
# author: BrikerMan | ||
# contact: [email protected] | ||
# blog: https://eliyar.biz | ||
|
||
# file: migration.py | ||
# time: 2:31 下午 | ||
import subprocess | ||
import logging | ||
|
||
|
||
guide = """ | ||
╭─────────────────────────────────────────────────────────────────────────╮ | ||
│ ◎ ○ ○ ░░░░░░░░░░░░░░░░░░░░░ Important Message ░░░░░░░░░░░░░░░░░░░░░░░░│ | ||
├─────────────────────────────────────────────────────────────────────────┤ | ||
│ │ | ||
│ We renamed again for consistency and clarity. │ | ||
│ From now on, it is all `kashgari`. │ | ||
│ Changelog: https://github.com/BrikerMan/Kashgari/releases/tag/v1.0.0 │ | ||
│ │ | ||
│ | Backend | pypi version | desc | │ | ||
│ | ---------------- | -------------- | -------------- | │ | ||
│ | TensorFlow 2.x | kashgari 2.x.x | coming soon | │ | ||
│ | TensorFlow 1.14+ | kashgari 1.x.x | | │ | ||
│ | Keras | kashgari 0.x.x | legacy version | │ | ||
│ │ | ||
╰─────────────────────────────────────────────────────────────────────────╯ | ||
""" | ||
|
||
|
||
def show_migration_guide(): | ||
requirements = subprocess.getoutput("pip freeze") | ||
for package in requirements.splitlines(): | ||
if '==' in package: | ||
package_name, package_version = package.split('==') | ||
if package_name == 'kashgari-tf': | ||
logging.warning(guide) | ||
|
||
|
||
if __name__ == "__main__": | ||
show_migration_guide() | ||
print("hello, world") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
# file: __version__.py.py | ||
# time: 2019-05-20 16:32 | ||
|
||
__version__ = '0.5.4' | ||
__version__ = '1.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
""" | ||
@author: BrikerMan | ||
@contact: [email protected] | ||
@blog: https://eliyar.biz | ||
@version: 1.0 | ||
@license: Apache Licence | ||
@file: setup.py | ||
@time: 2019-01-24 16:42 | ||
""" | ||
import codecs | ||
import os | ||
import pathlib | ||
import re | ||
|
||
from setuptools import find_packages, setup | ||
|
||
HERE = pathlib.Path(__file__).parent | ||
|
||
|
||
def read(*parts): | ||
with codecs.open(os.path.join(HERE, *parts), 'r') as fp: | ||
return fp.read() | ||
|
||
|
||
def find_version(*file_paths): | ||
version_file = read(*file_paths) | ||
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", | ||
version_file, re.M) | ||
if version_match: | ||
return version_match.group(1) | ||
raise RuntimeError("Unable to find version string.") | ||
|
||
|
||
__name__ = 'kashgari-tf' | ||
__author__ = "BrikerMan" | ||
__copyright__ = "Copyright 2018, BrikerMan" | ||
__credits__ = [] | ||
__license__ = "Apache License 2.0" | ||
__maintainer__ = "BrikerMan" | ||
__email__ = "[email protected]" | ||
|
||
__url__ = 'https://github.com/BrikerMan/Kashgari' | ||
__description__ = 'Simple, Keras-powered multilingual NLP framework,' \ | ||
' allows you to build your models in 5 minutes for named entity recognition (NER),' \ | ||
' part-of-speech tagging (PoS) and text classification tasks. ' \ | ||
'Includes BERT, GPT-2 and word2vec embedding.' | ||
|
||
__version__ = '0.5.5' | ||
README = (HERE / "README.md").read_text(encoding='utf-8') | ||
|
||
with codecs.open('requirements.txt', 'r', 'utf8') as reader: | ||
install_requires = list(map(lambda x: x.strip(), reader.readlines())) | ||
|
||
setup( | ||
name=__name__, | ||
version=__version__, | ||
description=__description__, | ||
python_requires='>3.6', | ||
long_description=README, | ||
long_description_content_type="text/markdown", | ||
author=__author__, | ||
author_email=__email__, | ||
url=__url__, | ||
packages=find_packages(exclude=('tests',)), | ||
install_requires=install_requires, | ||
include_package_data=True, | ||
license=__license__, | ||
classifiers=[ | ||
'License :: OSI Approved :: Apache Software License', | ||
# 'Programming Language :: Python', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: Implementation :: CPython', | ||
'Programming Language :: Python :: Implementation :: PyPy' | ||
], | ||
) | ||
|
||
if __name__ == "__main__": | ||
print("Hello world") |