跳转到主要内容

使用人工智能/机器学习技术从提交信息中生成CHANGELOG条目

项目描述

Glyph使用机器学习和自然语言处理来理解提交信息。这些知识可以用于将提交分类到如下类别:错误修复、功能添加、改进等。

  • 使用Glyph与Kebechet,可以从提交信息生成智能的CHANGELOG条目。

  • 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上可用,要安装它

pip install thoth-glyph

特性

  • 提交分类: 可以使用以下命令对单个提交进行分类

    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可以通过读取项目配置文件.thoth.yaml来使用Glyph。可以在该配置文件中指定Glyph支持的格式化和机器学习分类器。

  • 请参阅示例管理器配置此处

  • 请参阅使用Glyph生成的示例变更日志此处

模型和数据集

目前,Glyph附带了使用Facebook的fasttext库在从多个大型开源项目收集的约5000个提交数据集上训练的模型。该库可以轻松扩展以容纳更多模型。开发者欢迎贡献并提高分类精度。

参考文献

项目详情


下载文件

下载您平台上的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

thoth-glyph-0.1.5.tar.gz (5.5 MB 查看散列)

上传时间

构建分发

thoth_glyph-0.1.5-py3-none-any.whl (5.5 MB 查看散列)

上传时间 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面