使用AI/ML技术从提交消息中生成变更日志条目
thoth-glyph的Python项目详细描述
Glyph使用机器学习和自然语言处理来理解 提交消息。这些知识可用于将提交分类为 如错误修复、功能添加、改进等
- 使用带Kebechet的Glyph, 可以生成智能更改日志项。在
- Glyph还可以用作分析来自 本地存储库的使用情况(请参阅下面的存储库)
从Git运行此项目
git clone git@github.com:thoth-station/glyph.git # or use https
cd glyph
pipenv install --dev
PYTHONPATH=. pipenv run ./thoth-glyph --help
从PyPI安装此项目
此项目在PyPI上可用,要安装它:
^{pr2}$特点
Commit Classification:可以使用 以下命令:
thoth-glyph classify -m "COMMIT MESSAGE TO BE ANALYZED"
在对多个提交进行分类:多个提交可以一起分类 使用classify repo命令。默认情况下,此操作将所有 在存储库中提交。可选地,日期范围(YYYY-MM-DD)可以是 提供:
thoth-glyph classify-repo --path /path/to/git/repo --start 2020-05-01 --end 2020-05-10
在使用标记分类:也可以使用git标记选择提交。这个 下面的命令将在标记v3.7.1和v3.7.2之间选择提交
thoth-glyph classify-repo-by-tag --path /path/to/git/repo --start_tag v3.7.1 --end_tag v3.7.2
在
示例用法
$ thoth-glyph classify -m "Fixed server bug that impacted performance"2020-08-12 19:45:47,798 4594 WARNING thoth.common:346: Logging to a Sentry instance is turned off 2020-08-12 19:45:47,799 4594 INFO thoth.common:368: Logging to rsyslog endpoint is turned off 2020-08-12 19:45:47,799 4594 INFO glyph:68: Version: 0.0.0 2020-08-12 19:45:47,800 4594 INFO glyph:83: Classifying commit 2020-08-12 19:45:47,800 4594 INFO thoth.glyph.models:33: Model Path : /home/tussharm/.local/lib/python3.6/site- packages/thoth/glyph/data/model_commits_v2_quant.bin Label : corrective
$ thoth-glyph classify-repo --path /home/tussharm/fork/glyph/ --start 2020-08-08 --end 2020-08-12 2020-08-12 19:51:26,743 4873 WARNING thoth.common:346: Logging to a Sentry instance is turned off 2020-08-12 19:51:26,743 4873 INFO thoth.common:368: Logging to rsyslog endpoint is turned off 2020-08-12 19:51:26,744 4873 INFO glyph:68: Version: 0.0.0 2020-08-12 19:51:26,744 4873 INFO glyph:100: Classifying commits in the given date-range 2020-08-12 19:51:26,749 4873 INFO thoth.glyph.models:44: Model Path : /home/tussharm/.local/lib/python3.6/site-p packages/thoth/glyph/data/model_commits_v2_quant.bin 2020-08-12 19:51:26,768 4873 INFO thoth.glyph.models:52: 6 commits classified message labels_predicted 0 readme updated #27 perfective 1 merge pull request #1 from tushar7sharma/commi... nonfunctional 2 merge remote-tracking branch 'upstream/master'... features 3 grouping user-defined commit phrases (#28)* co... features 4 commits can be collected inside user-defined g... features 5 merge remote-tracking branch 'upstream/master'... features
与Kebechet集成
Kebechet可以通过从中读取项目配置来使用Glyph。托特·亚姆 文件。Glyph支持的格式化程序和ML classifiers可以在此中指定 配置文件。在
模型和数据集
目前Glyph附带了一个使用Facebook的fasttext库训练的模型,该模型覆盖从 多个大型开源项目(参见参考出版物了解更多 细节)。这个库可以很容易地扩展以容纳更多的模型。 欢迎开发人员投稿,提高分类精度。在
参考文献
- 项目
标签: