Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

fine_grained_changes_transformer_80.py 1.0 KB

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
  1. from typing import Optional
  2. from bohrapi.artifacts import Commit
  3. from bohrapi.core import Heuristic
  4. from bohrlabels.core import OneOrManyLabels
  5. from bohrlabels.labels import CommitLabel
  6. label_map = {
  7. "build": CommitLabel.NonBugFix,
  8. "chore": CommitLabel.NonBugFix,
  9. "ci": CommitLabel.NonBugFix,
  10. "docs": CommitLabel.NonBugFix,
  11. "feat": CommitLabel.Feature,
  12. "fix": CommitLabel.BugFix,
  13. "perf": CommitLabel.NonBugFix,
  14. "refactor": CommitLabel.Refactoring,
  15. "style": CommitLabel.NonBugFix,
  16. "test": CommitLabel.NonBugFix,
  17. }
  18. @Heuristic(Commit)
  19. def fine_grained_changes_transformer_80(commit: Commit) -> Optional[OneOrManyLabels]:
  20. if (
  21. "bohr" in commit.raw_data
  22. and "change_transformer_label/0_1" in commit.raw_data["bohr"]
  23. ):
  24. val = float(
  25. commit.raw_data["bohr"]["change_transformer_label/0_1"]["probability"]
  26. )
  27. if 0.8 < val <= 0.9:
  28. return label_map[
  29. commit.raw_data["bohr"]["change_transformer_label/0_1"]["label"]
  30. ]
Tip!

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

Comments

Loading...