Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Integration:  git github
hlib de18fbc364
improve spacy heursitics further, commented out old keyword heuristics
2 years ago
06413c0379
Upgrade/bohr 0.4.4 (#172)
3 years ago
2f19bc8c2a
update squirrel port
2 years ago
d87360a99c
update automatic dvc commit message to follow conventional commit conventions
2 years ago
64a4060e7a
Add transformer (#148)
3 years ago
bin
e1b3e5db44
ci: download spacy mdoel
2 years ago
f71b6f3631
upgrade to bohr 0.4.7 (#185)
2 years ago
b5721a3267
add developer labeled dataset (#195)
2 years ago
b5721a3267
add developer labeled dataset (#195)
2 years ago
76c09e2408
upgrade bohr to 0.3.9 (#162)
3 years ago
doc
ca4ad4c06f
doc images and gifs
2 years ago
b5721a3267
add developer labeled dataset (#195)
2 years ago
123969a9c5
dvc output
2 years ago
de18fbc364
improve spacy heursitics further, commented out old keyword heuristics
2 years ago
123969a9c5
dvc output
2 years ago
f71b6f3631
upgrade to bohr 0.4.7 (#185)
2 years ago
c4d5fe473d
freeze transformer stages
3 years ago
123969a9c5
dvc output
2 years ago
64a4060e7a
Add transformer (#148)
3 years ago
f2b487f68f
WIP #76: restructure the repo into framework and other (#90)
3 years ago
123969a9c5
dvc output
2 years ago
4cc932160e
add dvc pre-commit hooks
3 years ago
8dd7c80d2e
Pylint - black compatibility (#80)
3 years ago
5cbb8ede96
Fix reproduce action (#113)
3 years ago
7f11f72192
use setup-bohr script for travis build
3 years ago
b28a1b48f2
add license (#118)
3 years ago
a10329091d
minor readme updates
2 years ago
123969a9c5
dvc output
2 years ago
123969a9c5
dvc output
2 years ago
123969a9c5
dvc output
2 years ago
123969a9c5
dvc output
2 years ago
f71b6f3631
upgrade to bohr 0.4.7 (#185)
2 years ago
1c13682e5a
Add renovate.json
3 years ago
f0a84ba0d2
Add pylint and fix some warnings (#78)
3 years ago
de18fbc364
improve spacy heursitics further, commented out old keyword heuristics
2 years ago
Storage Buckets
Data Pipeline
Legend
DVC Managed File
Git Managed File
Metric
Stage File
External File

README.rst

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
  1. BOHR (Big Old Heuristic Repository)
  2. ----------------------------------
  3. |GitHub license| |Maintainability| |GitHub make-a-pull-requests|
  4. BOHR is a **repository of heuristics** for categorization of software engineering artifacts, e.g. commits, bug reports, etc.
  5. Categorization of artifacts is often required to create ground-truth datasets to train machine learning models on. For example, to train a model that classifies commits as "feature", "bugfix", or "refactoring", one needs to have a dataset of commits with these labels assigned.
  6. Since creating a large dataset manually is expensive, the alternative is to come up with "heuristics", short programs that can assign noisy labels to artifacts automatically. Implementing **a large number of such heuristics** and **combining their outputs** "smartly" is the idea behind `snorkel <https://www.snorkel.org/>`_, the state-of-the-art `weak supervision <http://ai.stanford.edu/blog/weak-supervision/>`_ tool.
  7. BOHR is a wrapper around snorkel which:
  8. * **Simplifies** the process of **adding new heuristics** and **evaluating their effectiveness**;
  9. * **Labels the datasets** registered with BOHR and **automatically updates the labels** once heuristics are added;
  10. * Keeps track of heursitics used for each version of generated datasets and models, and, in general, makes sure they are **reproducible** and **easily accessable** by using `DVC <https://dvc.org>`_.
  11. .. contents:: **Contents**
  12. :backlinks: none
  13. How do heuristics look like?
  14. ===================================
  15. .. code-block:: python
  16. # other imports
  17. ...
  18. from bohr.core import Heuristic
  19. from bohr.collection.artifacts import Commit
  20. from bohr.labels import CommitLabel
  21. @Heuristic(Commit)
  22. def bugless_if_many_files_changes(commit: Commit) -> Optional[Labels]:
  23. if len(commit.files) > 6:
  24. return CommitLabel.NonBugFix
  25. else:
  26. return None
  27. Important things to note:
  28. #. A heuristics is marked with the ``Heuristic`` decorator, and the artifact type to which it is applied is passed to it as a parameter;
  29. #. The artifact instance is exposed to the heuristic as a function parameter; the properties of the artifact object can be used to implement the logic;
  30. #. For the label to be assigned to the artifact, it has to be returned from the function; the heuristic must assign one of the labels defined in the BOHR label hierarchy or ``None`` if it abstains on the data point.
  31. BOHR usage scenarios
  32. ===================================
  33. 1. Reusing existing heuristics
  34. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35. Heuristics already implemented in BOHR are used to train label models. The label mdoels are continuosly improved as more heuristics are added and are used to label the datasets that been added to BOHR. These datasets can be easily accesed and used as they are. Moreover, you can use the label models to label your own datasets.
  36. 2. Implementing new heuristics for existing tasks
  37. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. If you want to help working on the tasks already defined in BOHR, you can add more heuristics to improve the label model and the datasets further. Once new heuristics are implemented, they can be submitted as a pull request to BOHR, which will automatically re-run the pipiline (the label model will be re-trained, the datasets will be re-labeled, and the metrics will be recalculated. The pull request will be accepted if the metrics are improved.
  39. 3. Implementing heuristics for new tasks and artifacts
  40. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  41. BOHR is designed to be extensible. You can esily define new artifact classes and tasks, and start implementing heuristics for those tasks. Note that some heuristics already added for other tasks might be reused for a new task. Please refer to the documentation for more details.
  42. Overview of BOHR abstractions
  43. ================================
  44. .. raw:: html
  45. <img src="doc/bohr_abstractions.png" width="600px">
  46. Quick Start
  47. ============
  48. Installation
  49. ~~~~~~~~~~~~~
  50. Python >= 3.8 is required, use of virtual environment is strongly recommended.
  51. #. Run ``git clone https://github.com/giganticode/bohr && cd bohr``
  52. #. Install BOHR framework library: ``bin/setup-bohr.sh``. This will install `bohr-framework <https://github.com/giganticode/bohr-framework>`_, dependencies and tools to run heursistics.
  53. Important commands
  54. ~~~~~~~~~~~~~~~~~~~
  55. +-----------------------------------+-------------------------------------------------------------------+
  56. | | Command |
  57. +===================================+===================================================================+
  58. | Pull existing labeled dataset | | ``$ bohr pull bugginess 200k-commits`` |
  59. +-----------------------------------+-------------------------------------------------------------------+
  60. | Label your dataset | | ``$ bohr dataset add ~/new_commit_dataset.csv -t commit`` |
  61. | | | ``$ bohr task add-dataset bugginess new_commit_dataset --repro``|
  62. +-----------------------------------+-------------------------------------------------------------------+
  63. | Add heuristic(s), re-train | | ``$ vi heuristics/commit_files.py`` |
  64. | label model, and update labels | | ``$ bohr repro bugginess`` |
  65. +-----------------------------------+-------------------------------------------------------------------+
  66. | Add a new task | | ``$ bohr task add tangled-commits \`` |
  67. | | | ``... -l TangledCommit.NonTangled,TangledCommit.Tangled \`` |
  68. | | | ``... --repro`` |
  69. | | | |
  70. +-----------------------------------+-------------------------------------------------------------------+
  71. Contribute to the framework
  72. =============================
  73. To contribute to the BOHR-framework, which is used to manage the BOHR repo, please refer to the `bohr-framework repo <https://github.com/giganticode/bohr-framework>`_.
  74. Pre-prints and publications
  75. =============================
  76. .. code-block::
  77. @inproceedings{babii2021mining,
  78. title={Mining Software Repositories with a Collaborative Heuristic Repository},
  79. author={Babii, Hlib and Prenner, Julian Aron and Stricker, Laurin and Karmakar, Anjan and Janes, Andrea and Robbes, Romain},
  80. booktitle={2021 IEEE/ACM 43rd International Conference on Software Engineering: New Ideas and Emerging Results (ICSE-NIER)},
  81. pages={106--110},
  82. year={2021},
  83. organization={IEEE}
  84. }
  85. .. |GitHub license| image:: https://img.shields.io/github/license/giganticode/bohr.svg
  86. :target: https://github.com/giganticode/bohr/blob/master/LICENSE
  87. .. |GitHub make-a-pull-requests| image:: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
  88. :target: http://makeapullrequest.com
  89. .. |Maintainability| image:: https://codeclimate.com/github/giganticode/bohr/badges/gpa.svg
  90. :target: https://codeclimate.com/github/giganticode/bohr
  91. :alt: Code Climate
Tip!

Press p or to see the previous file or, n or to see the next file

About

Big Old Heuristic Repository

Collaborators 1

Comments

Loading...