pymelvil 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. pymelvil-0.3.0/.github/workflows/release.yml +40 -0
  2. pymelvil-0.3.0/.github/workflows/test.yml +25 -0
  3. pymelvil-0.3.0/.gitignore +18 -0
  4. pymelvil-0.3.0/CODE_OF_CONDUCT.md +4 -0
  5. pymelvil-0.3.0/CONTRIBUTING.md +36 -0
  6. pymelvil-0.3.0/LICENSE +21 -0
  7. pymelvil-0.3.0/PKG-INFO +161 -0
  8. pymelvil-0.3.0/README.md +114 -0
  9. pymelvil-0.3.0/SECURITY.md +8 -0
  10. pymelvil-0.3.0/agnews_small.csv +1201 -0
  11. pymelvil-0.3.0/agnews_topics.v1.json +190 -0
  12. pymelvil-0.3.0/benchmarks/RESULTS.md +112 -0
  13. pymelvil-0.3.0/benchmarks/confirmation_tables.md +16 -0
  14. pymelvil-0.3.0/benchmarks/data/ag_news.json +2214 -0
  15. pymelvil-0.3.0/benchmarks/data/banking77.json +2235 -0
  16. pymelvil-0.3.0/benchmarks/data/clinc150.json +2240 -0
  17. pymelvil-0.3.0/benchmarks/data/emotion.json +2216 -0
  18. pymelvil-0.3.0/benchmarks/data/massive.json +2240 -0
  19. pymelvil-0.3.0/benchmarks/data/sst5.json +2215 -0
  20. pymelvil-0.3.0/benchmarks/data/stance_abortion.json +2133 -0
  21. pymelvil-0.3.0/benchmarks/data/trec.json +2216 -0
  22. pymelvil-0.3.0/benchmarks/make_confirmation_report.py +118 -0
  23. pymelvil-0.3.0/benchmarks/make_report.py +222 -0
  24. pymelvil-0.3.0/benchmarks/miprov2_arm.py +130 -0
  25. pymelvil-0.3.0/benchmarks/plots/confirmation_test_accuracy.png +0 -0
  26. pymelvil-0.3.0/benchmarks/plots/dev_curves.png +0 -0
  27. pymelvil-0.3.0/benchmarks/plots/test_accuracy_by_arm.png +0 -0
  28. pymelvil-0.3.0/benchmarks/prep_data.py +165 -0
  29. pymelvil-0.3.0/benchmarks/results/ag_news_full_s0.json +59 -0
  30. pymelvil-0.3.0/benchmarks/results/ag_news_full_s1.json +59 -0
  31. pymelvil-0.3.0/benchmarks/results/ag_news_full_s2.json +55 -0
  32. pymelvil-0.3.0/benchmarks/results/ag_news_no_codebook_s0.json +47 -0
  33. pymelvil-0.3.0/benchmarks/results/ag_news_no_codebook_s1.json +47 -0
  34. pymelvil-0.3.0/benchmarks/results/ag_news_no_codebook_s2.json +47 -0
  35. pymelvil-0.3.0/benchmarks/results/ag_news_no_confusion_s0.json +63 -0
  36. pymelvil-0.3.0/benchmarks/results/ag_news_no_confusion_s1.json +63 -0
  37. pymelvil-0.3.0/benchmarks/results/ag_news_no_confusion_s2.json +67 -0
  38. pymelvil-0.3.0/benchmarks/results/ag_news_no_mining_s0.json +59 -0
  39. pymelvil-0.3.0/benchmarks/results/ag_news_no_mining_s1.json +63 -0
  40. pymelvil-0.3.0/benchmarks/results/ag_news_no_mining_s2.json +59 -0
  41. pymelvil-0.3.0/benchmarks/results/ag_news_seed_s0.json +42 -0
  42. pymelvil-0.3.0/benchmarks/results/ag_news_transfer_s0.json +10 -0
  43. pymelvil-0.3.0/benchmarks/results/ag_news_transfer_s1.json +10 -0
  44. pymelvil-0.3.0/benchmarks/results/ag_news_transfer_s2.json +10 -0
  45. pymelvil-0.3.0/benchmarks/results/ag_news_vanilla_s0.json +71 -0
  46. pymelvil-0.3.0/benchmarks/results/ag_news_vanilla_s1.json +75 -0
  47. pymelvil-0.3.0/benchmarks/results/ag_news_vanilla_s2.json +71 -0
  48. pymelvil-0.3.0/benchmarks/results/banking77_full_s0.json +63 -0
  49. pymelvil-0.3.0/benchmarks/results/banking77_full_s1.json +63 -0
  50. pymelvil-0.3.0/benchmarks/results/banking77_full_s2.json +63 -0
  51. pymelvil-0.3.0/benchmarks/results/banking77_no_codebook_s0.json +47 -0
  52. pymelvil-0.3.0/benchmarks/results/banking77_no_codebook_s1.json +47 -0
  53. pymelvil-0.3.0/benchmarks/results/banking77_no_codebook_s2.json +47 -0
  54. pymelvil-0.3.0/benchmarks/results/banking77_no_confusion_s0.json +63 -0
  55. pymelvil-0.3.0/benchmarks/results/banking77_no_confusion_s1.json +55 -0
  56. pymelvil-0.3.0/benchmarks/results/banking77_no_confusion_s2.json +63 -0
  57. pymelvil-0.3.0/benchmarks/results/banking77_no_mining_s0.json +63 -0
  58. pymelvil-0.3.0/benchmarks/results/banking77_no_mining_s1.json +67 -0
  59. pymelvil-0.3.0/benchmarks/results/banking77_no_mining_s2.json +67 -0
  60. pymelvil-0.3.0/benchmarks/results/banking77_seed_s0.json +42 -0
  61. pymelvil-0.3.0/benchmarks/results/banking77_transfer_s0.json +10 -0
  62. pymelvil-0.3.0/benchmarks/results/banking77_transfer_s1.json +10 -0
  63. pymelvil-0.3.0/benchmarks/results/banking77_transfer_s2.json +10 -0
  64. pymelvil-0.3.0/benchmarks/results/banking77_vanilla_s0.json +75 -0
  65. pymelvil-0.3.0/benchmarks/results/banking77_vanilla_s1.json +71 -0
  66. pymelvil-0.3.0/benchmarks/results/banking77_vanilla_s2.json +75 -0
  67. pymelvil-0.3.0/benchmarks/results/clinc150_full_s0.json +51 -0
  68. pymelvil-0.3.0/benchmarks/results/clinc150_full_s1.json +51 -0
  69. pymelvil-0.3.0/benchmarks/results/clinc150_full_s2.json +51 -0
  70. pymelvil-0.3.0/benchmarks/results/clinc150_no_codebook_s0.json +42 -0
  71. pymelvil-0.3.0/benchmarks/results/clinc150_no_codebook_s1.json +42 -0
  72. pymelvil-0.3.0/benchmarks/results/clinc150_no_codebook_s2.json +42 -0
  73. pymelvil-0.3.0/benchmarks/results/clinc150_no_confusion_s0.json +51 -0
  74. pymelvil-0.3.0/benchmarks/results/clinc150_no_confusion_s1.json +47 -0
  75. pymelvil-0.3.0/benchmarks/results/clinc150_no_confusion_s2.json +47 -0
  76. pymelvil-0.3.0/benchmarks/results/clinc150_no_mining_s0.json +51 -0
  77. pymelvil-0.3.0/benchmarks/results/clinc150_no_mining_s1.json +51 -0
  78. pymelvil-0.3.0/benchmarks/results/clinc150_no_mining_s2.json +51 -0
  79. pymelvil-0.3.0/benchmarks/results/clinc150_seed_s0.json +42 -0
  80. pymelvil-0.3.0/benchmarks/results/clinc150_transfer_s0.json +10 -0
  81. pymelvil-0.3.0/benchmarks/results/clinc150_transfer_s1.json +10 -0
  82. pymelvil-0.3.0/benchmarks/results/clinc150_transfer_s2.json +10 -0
  83. pymelvil-0.3.0/benchmarks/results/clinc150_vanilla_s0.json +63 -0
  84. pymelvil-0.3.0/benchmarks/results/clinc150_vanilla_s1.json +55 -0
  85. pymelvil-0.3.0/benchmarks/results/clinc150_vanilla_s2.json +59 -0
  86. pymelvil-0.3.0/benchmarks/results/emotion_full_s0.json +67 -0
  87. pymelvil-0.3.0/benchmarks/results/emotion_full_s1.json +67 -0
  88. pymelvil-0.3.0/benchmarks/results/emotion_full_s2.json +59 -0
  89. pymelvil-0.3.0/benchmarks/results/emotion_no_codebook_s0.json +51 -0
  90. pymelvil-0.3.0/benchmarks/results/emotion_no_codebook_s1.json +63 -0
  91. pymelvil-0.3.0/benchmarks/results/emotion_no_codebook_s2.json +59 -0
  92. pymelvil-0.3.0/benchmarks/results/emotion_no_confusion_s0.json +67 -0
  93. pymelvil-0.3.0/benchmarks/results/emotion_no_confusion_s1.json +67 -0
  94. pymelvil-0.3.0/benchmarks/results/emotion_no_confusion_s2.json +67 -0
  95. pymelvil-0.3.0/benchmarks/results/emotion_no_mining_s0.json +67 -0
  96. pymelvil-0.3.0/benchmarks/results/emotion_no_mining_s1.json +71 -0
  97. pymelvil-0.3.0/benchmarks/results/emotion_no_mining_s2.json +63 -0
  98. pymelvil-0.3.0/benchmarks/results/emotion_seed_s0.json +42 -0
  99. pymelvil-0.3.0/benchmarks/results/emotion_transfer_s0.json +10 -0
  100. pymelvil-0.3.0/benchmarks/results/emotion_transfer_s1.json +10 -0
  101. pymelvil-0.3.0/benchmarks/results/emotion_transfer_s2.json +10 -0
  102. pymelvil-0.3.0/benchmarks/results/emotion_vanilla_s0.json +75 -0
  103. pymelvil-0.3.0/benchmarks/results/emotion_vanilla_s1.json +75 -0
  104. pymelvil-0.3.0/benchmarks/results/emotion_vanilla_s2.json +75 -0
  105. pymelvil-0.3.0/benchmarks/results/massive_full_s0.json +67 -0
  106. pymelvil-0.3.0/benchmarks/results/massive_full_s1.json +67 -0
  107. pymelvil-0.3.0/benchmarks/results/massive_full_s2.json +63 -0
  108. pymelvil-0.3.0/benchmarks/results/massive_no_codebook_s0.json +63 -0
  109. pymelvil-0.3.0/benchmarks/results/massive_no_codebook_s1.json +55 -0
  110. pymelvil-0.3.0/benchmarks/results/massive_no_codebook_s2.json +59 -0
  111. pymelvil-0.3.0/benchmarks/results/massive_no_confusion_s0.json +59 -0
  112. pymelvil-0.3.0/benchmarks/results/massive_no_confusion_s1.json +59 -0
  113. pymelvil-0.3.0/benchmarks/results/massive_no_confusion_s2.json +63 -0
  114. pymelvil-0.3.0/benchmarks/results/massive_no_mining_s0.json +71 -0
  115. pymelvil-0.3.0/benchmarks/results/massive_no_mining_s1.json +67 -0
  116. pymelvil-0.3.0/benchmarks/results/massive_no_mining_s2.json +67 -0
  117. pymelvil-0.3.0/benchmarks/results/massive_seed_s0.json +42 -0
  118. pymelvil-0.3.0/benchmarks/results/massive_transfer_s0.json +10 -0
  119. pymelvil-0.3.0/benchmarks/results/massive_transfer_s1.json +10 -0
  120. pymelvil-0.3.0/benchmarks/results/massive_transfer_s2.json +10 -0
  121. pymelvil-0.3.0/benchmarks/results/massive_vanilla_s0.json +75 -0
  122. pymelvil-0.3.0/benchmarks/results/massive_vanilla_s1.json +75 -0
  123. pymelvil-0.3.0/benchmarks/results/massive_vanilla_s2.json +75 -0
  124. pymelvil-0.3.0/benchmarks/results/trec_full_s0.json +67 -0
  125. pymelvil-0.3.0/benchmarks/results/trec_full_s1.json +67 -0
  126. pymelvil-0.3.0/benchmarks/results/trec_full_s2.json +71 -0
  127. pymelvil-0.3.0/benchmarks/results/trec_no_codebook_s0.json +67 -0
  128. pymelvil-0.3.0/benchmarks/results/trec_no_codebook_s1.json +51 -0
  129. pymelvil-0.3.0/benchmarks/results/trec_no_codebook_s2.json +59 -0
  130. pymelvil-0.3.0/benchmarks/results/trec_no_confusion_s0.json +67 -0
  131. pymelvil-0.3.0/benchmarks/results/trec_no_confusion_s1.json +67 -0
  132. pymelvil-0.3.0/benchmarks/results/trec_no_confusion_s2.json +71 -0
  133. pymelvil-0.3.0/benchmarks/results/trec_no_mining_s0.json +71 -0
  134. pymelvil-0.3.0/benchmarks/results/trec_no_mining_s1.json +71 -0
  135. pymelvil-0.3.0/benchmarks/results/trec_no_mining_s2.json +75 -0
  136. pymelvil-0.3.0/benchmarks/results/trec_seed_s0.json +42 -0
  137. pymelvil-0.3.0/benchmarks/results/trec_transfer_s0.json +10 -0
  138. pymelvil-0.3.0/benchmarks/results/trec_transfer_s1.json +10 -0
  139. pymelvil-0.3.0/benchmarks/results/trec_transfer_s2.json +10 -0
  140. pymelvil-0.3.0/benchmarks/results/trec_vanilla_s0.json +75 -0
  141. pymelvil-0.3.0/benchmarks/results/trec_vanilla_s1.json +75 -0
  142. pymelvil-0.3.0/benchmarks/results/trec_vanilla_s2.json +75 -0
  143. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_full_s10.json +14 -0
  144. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_full_s11.json +14 -0
  145. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_full_s12.json +14 -0
  146. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_miprov2_s10.json +15 -0
  147. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_miprov2_s11.json +15 -0
  148. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_miprov2_s12.json +15 -0
  149. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_seed_s10.json +14 -0
  150. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_vanilla_s10.json +14 -0
  151. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_vanilla_s11.json +14 -0
  152. pymelvil-0.3.0/benchmarks/results_confirm/ag_news_vanilla_s12.json +14 -0
  153. pymelvil-0.3.0/benchmarks/results_confirm/banking77_full_s10.json +14 -0
  154. pymelvil-0.3.0/benchmarks/results_confirm/banking77_full_s11.json +14 -0
  155. pymelvil-0.3.0/benchmarks/results_confirm/banking77_full_s12.json +14 -0
  156. pymelvil-0.3.0/benchmarks/results_confirm/banking77_miprov2_s10.json +15 -0
  157. pymelvil-0.3.0/benchmarks/results_confirm/banking77_miprov2_s11.json +15 -0
  158. pymelvil-0.3.0/benchmarks/results_confirm/banking77_miprov2_s12.json +15 -0
  159. pymelvil-0.3.0/benchmarks/results_confirm/banking77_seed_s10.json +14 -0
  160. pymelvil-0.3.0/benchmarks/results_confirm/banking77_vanilla_s10.json +14 -0
  161. pymelvil-0.3.0/benchmarks/results_confirm/banking77_vanilla_s11.json +14 -0
  162. pymelvil-0.3.0/benchmarks/results_confirm/banking77_vanilla_s12.json +14 -0
  163. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_full_s10.json +14 -0
  164. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_full_s11.json +14 -0
  165. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_full_s12.json +14 -0
  166. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_miprov2_s10.json +15 -0
  167. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_miprov2_s11.json +15 -0
  168. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_miprov2_s12.json +15 -0
  169. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_seed_s10.json +14 -0
  170. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_vanilla_s10.json +14 -0
  171. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_vanilla_s11.json +14 -0
  172. pymelvil-0.3.0/benchmarks/results_confirm/clinc150_vanilla_s12.json +14 -0
  173. pymelvil-0.3.0/benchmarks/results_confirm/emotion_full_s10.json +14 -0
  174. pymelvil-0.3.0/benchmarks/results_confirm/emotion_full_s11.json +14 -0
  175. pymelvil-0.3.0/benchmarks/results_confirm/emotion_full_s12.json +14 -0
  176. pymelvil-0.3.0/benchmarks/results_confirm/emotion_miprov2_s10.json +15 -0
  177. pymelvil-0.3.0/benchmarks/results_confirm/emotion_miprov2_s11.json +15 -0
  178. pymelvil-0.3.0/benchmarks/results_confirm/emotion_miprov2_s12.json +15 -0
  179. pymelvil-0.3.0/benchmarks/results_confirm/emotion_seed_s10.json +14 -0
  180. pymelvil-0.3.0/benchmarks/results_confirm/emotion_vanilla_s10.json +14 -0
  181. pymelvil-0.3.0/benchmarks/results_confirm/emotion_vanilla_s11.json +14 -0
  182. pymelvil-0.3.0/benchmarks/results_confirm/emotion_vanilla_s12.json +14 -0
  183. pymelvil-0.3.0/benchmarks/results_confirm/massive_full_s10.json +14 -0
  184. pymelvil-0.3.0/benchmarks/results_confirm/massive_full_s11.json +14 -0
  185. pymelvil-0.3.0/benchmarks/results_confirm/massive_full_s12.json +14 -0
  186. pymelvil-0.3.0/benchmarks/results_confirm/massive_miprov2_s10.json +15 -0
  187. pymelvil-0.3.0/benchmarks/results_confirm/massive_miprov2_s11.json +15 -0
  188. pymelvil-0.3.0/benchmarks/results_confirm/massive_miprov2_s12.json +15 -0
  189. pymelvil-0.3.0/benchmarks/results_confirm/massive_seed_s10.json +14 -0
  190. pymelvil-0.3.0/benchmarks/results_confirm/massive_vanilla_s10.json +14 -0
  191. pymelvil-0.3.0/benchmarks/results_confirm/massive_vanilla_s11.json +14 -0
  192. pymelvil-0.3.0/benchmarks/results_confirm/massive_vanilla_s12.json +14 -0
  193. pymelvil-0.3.0/benchmarks/results_confirm/sst5_full_s10.json +14 -0
  194. pymelvil-0.3.0/benchmarks/results_confirm/sst5_full_s11.json +14 -0
  195. pymelvil-0.3.0/benchmarks/results_confirm/sst5_full_s12.json +14 -0
  196. pymelvil-0.3.0/benchmarks/results_confirm/sst5_miprov2_s10.json +15 -0
  197. pymelvil-0.3.0/benchmarks/results_confirm/sst5_miprov2_s11.json +15 -0
  198. pymelvil-0.3.0/benchmarks/results_confirm/sst5_miprov2_s12.json +15 -0
  199. pymelvil-0.3.0/benchmarks/results_confirm/sst5_seed_s10.json +14 -0
  200. pymelvil-0.3.0/benchmarks/results_confirm/sst5_vanilla_s10.json +14 -0
  201. pymelvil-0.3.0/benchmarks/results_confirm/sst5_vanilla_s11.json +14 -0
  202. pymelvil-0.3.0/benchmarks/results_confirm/sst5_vanilla_s12.json +14 -0
  203. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_full_s10.json +14 -0
  204. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_full_s11.json +14 -0
  205. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_full_s12.json +14 -0
  206. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_miprov2_s10.json +15 -0
  207. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_miprov2_s11.json +15 -0
  208. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_miprov2_s12.json +15 -0
  209. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_seed_s10.json +14 -0
  210. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_vanilla_s10.json +14 -0
  211. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_vanilla_s11.json +14 -0
  212. pymelvil-0.3.0/benchmarks/results_confirm/stance_abortion_vanilla_s12.json +14 -0
  213. pymelvil-0.3.0/benchmarks/results_confirm/trec_full_s10.json +14 -0
  214. pymelvil-0.3.0/benchmarks/results_confirm/trec_full_s11.json +14 -0
  215. pymelvil-0.3.0/benchmarks/results_confirm/trec_full_s12.json +14 -0
  216. pymelvil-0.3.0/benchmarks/results_confirm/trec_miprov2_s10.json +15 -0
  217. pymelvil-0.3.0/benchmarks/results_confirm/trec_miprov2_s11.json +15 -0
  218. pymelvil-0.3.0/benchmarks/results_confirm/trec_miprov2_s12.json +15 -0
  219. pymelvil-0.3.0/benchmarks/results_confirm/trec_seed_s10.json +14 -0
  220. pymelvil-0.3.0/benchmarks/results_confirm/trec_vanilla_s10.json +14 -0
  221. pymelvil-0.3.0/benchmarks/results_confirm/trec_vanilla_s11.json +14 -0
  222. pymelvil-0.3.0/benchmarks/results_confirm/trec_vanilla_s12.json +14 -0
  223. pymelvil-0.3.0/benchmarks/results_iter/ag_news_full_s0.json +34 -0
  224. pymelvil-0.3.0/benchmarks/results_iter/ag_news_full_s1.json +34 -0
  225. pymelvil-0.3.0/benchmarks/results_iter/ag_news_full_s2.json +30 -0
  226. pymelvil-0.3.0/benchmarks/results_iter/ag_news_miprov2_s0.json +15 -0
  227. pymelvil-0.3.0/benchmarks/results_iter/ag_news_no_confusion_s0.json +38 -0
  228. pymelvil-0.3.0/benchmarks/results_iter/ag_news_no_confusion_s1.json +38 -0
  229. pymelvil-0.3.0/benchmarks/results_iter/ag_news_no_confusion_s2.json +42 -0
  230. pymelvil-0.3.0/benchmarks/results_iter/banking77_full_s0.json +38 -0
  231. pymelvil-0.3.0/benchmarks/results_iter/banking77_full_s1.json +30 -0
  232. pymelvil-0.3.0/benchmarks/results_iter/banking77_full_s2.json +38 -0
  233. pymelvil-0.3.0/benchmarks/results_iter/banking77_no_confusion_s0.json +38 -0
  234. pymelvil-0.3.0/benchmarks/results_iter/banking77_no_confusion_s1.json +30 -0
  235. pymelvil-0.3.0/benchmarks/results_iter/banking77_no_confusion_s2.json +38 -0
  236. pymelvil-0.3.0/benchmarks/results_iter/massive_full_s0.json +34 -0
  237. pymelvil-0.3.0/benchmarks/results_iter/massive_full_s1.json +42 -0
  238. pymelvil-0.3.0/benchmarks/results_iter/massive_full_s2.json +42 -0
  239. pymelvil-0.3.0/benchmarks/results_iter/massive_no_confusion_s0.json +34 -0
  240. pymelvil-0.3.0/benchmarks/results_iter/massive_no_confusion_s1.json +34 -0
  241. pymelvil-0.3.0/benchmarks/results_iter/massive_no_confusion_s2.json +38 -0
  242. pymelvil-0.3.0/benchmarks/results_tables.md +90 -0
  243. pymelvil-0.3.0/benchmarks/run_confirmation.py +125 -0
  244. pymelvil-0.3.0/benchmarks/run_iteration.py +112 -0
  245. pymelvil-0.3.0/benchmarks/run_matrix.py +200 -0
  246. pymelvil-0.3.0/docs/api.md +117 -0
  247. pymelvil-0.3.0/examples/agnews_demo.ipynb +194 -0
  248. pymelvil-0.3.0/examples/quickstart.py +44 -0
  249. pymelvil-0.3.0/melvil/__init__.py +52 -0
  250. pymelvil-0.3.0/melvil/_about.py +6 -0
  251. pymelvil-0.3.0/melvil/adapter.py +160 -0
  252. pymelvil-0.3.0/melvil/artifact.py +194 -0
  253. pymelvil-0.3.0/melvil/config.py +114 -0
  254. pymelvil-0.3.0/melvil/costs.py +125 -0
  255. pymelvil-0.3.0/melvil/data.py +139 -0
  256. pymelvil-0.3.0/melvil/evaluate.py +158 -0
  257. pymelvil-0.3.0/melvil/features/__init__.py +3 -0
  258. pymelvil-0.3.0/melvil/features/confusion.py +155 -0
  259. pymelvil-0.3.0/melvil/features/mining.py +122 -0
  260. pymelvil-0.3.0/melvil/lmutil.py +60 -0
  261. pymelvil-0.3.0/melvil/optimize.py +299 -0
  262. pymelvil-0.3.0/melvil/program.py +93 -0
  263. pymelvil-0.3.0/melvil/proposer.py +153 -0
  264. pymelvil-0.3.0/melvil/py.typed +0 -0
  265. pymelvil-0.3.0/melvil/screen.py +108 -0
  266. pymelvil-0.3.0/melvil/taskspec.py +174 -0
  267. pymelvil-0.3.0/melvil/testing.py +174 -0
  268. pymelvil-0.3.0/pyproject.toml +53 -0
  269. pymelvil-0.3.0/tests/test_artifact.py +84 -0
  270. pymelvil-0.3.0/tests/test_config.py +45 -0
  271. pymelvil-0.3.0/tests/test_costs.py +43 -0
  272. pymelvil-0.3.0/tests/test_features_v02.py +148 -0
  273. pymelvil-0.3.0/tests/test_offline_e2e.py +132 -0
  274. pymelvil-0.3.0/tests/test_taskspec.py +87 -0
@@ -0,0 +1,40 @@
1
+ name: release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - uses: actions/setup-python@v5
13
+ with:
14
+ python-version: "3.12"
15
+ - name: Build sdist and wheel
16
+ run: |
17
+ pip install build
18
+ python -m build
19
+ - name: Check metadata
20
+ run: |
21
+ pip install twine
22
+ twine check dist/*
23
+ - uses: actions/upload-artifact@v4
24
+ with:
25
+ name: dist
26
+ path: dist/
27
+
28
+ publish:
29
+ needs: build
30
+ runs-on: ubuntu-latest
31
+ environment: pypi
32
+ permissions:
33
+ id-token: write
34
+ steps:
35
+ - uses: actions/download-artifact@v4
36
+ with:
37
+ name: dist
38
+ path: dist/
39
+ - name: Publish to PyPI (trusted publishing)
40
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,25 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - name: Install
21
+ run: pip install -e '.[dev]'
22
+ - name: Lint
23
+ run: ruff check .
24
+ - name: Test (offline, fake LMs, no API keys)
25
+ run: pytest
@@ -0,0 +1,18 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ .dspy_cache/
8
+ runs/
9
+ .pytest_cache/
10
+ .ruff_cache/
11
+ .ipynb_checkpoints/
12
+ .env
13
+ runs_iter/
14
+ runs_confirm/
15
+ benchmarks/runs/
16
+ benchmarks/*.log
17
+ _export/
18
+ _snapshot.tar.gz
@@ -0,0 +1,4 @@
1
+ # Code of Conduct
2
+
3
+ This project follows the [Contributor Covenant v2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
4
+ Instances of unacceptable behavior may be reported to harish.siravuri@gmail.com.
@@ -0,0 +1,36 @@
1
+ # Contributing to melvil
2
+
3
+ Thanks for considering a contribution!
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ python -m venv .venv && source .venv/bin/activate
9
+ pip install -e '.[dev]'
10
+ pytest # must stay green with NO API keys (fake-LM offline suite)
11
+ ruff check .
12
+ ```
13
+
14
+ ## Ground rules
15
+
16
+ - **No API keys in tests.** Anything touching an LLM in tests goes through
17
+ `melvil.testing` fakes. If your feature can't be exercised offline,
18
+ extend the fakes first.
19
+ - **The artifact is the contract.** Changes to `PromptArtifact` fields bump
20
+ `schema_version` and keep `load()` backwards-compatible.
21
+ - **Budget honesty.** Any code path that spends metric calls must account for
22
+ them in the artifact's `budget` block.
23
+ - Type hints on the public API; `ruff check .` clean; match the surrounding
24
+ style.
25
+
26
+ ## Where things live
27
+
28
+ See the module map in [docs/api.md](docs/api.md) and the architecture notes in
29
+ module docstrings — `adapter.py` (gepa integration), `features/` (the
30
+ classification layer), `proposer.py` (reflection prompting).
31
+
32
+ ## Benchmarks
33
+
34
+ `benchmarks/` is a fixed matrix (datasets × arms × seeds) driven by the
35
+ library. If you claim a quality improvement, add or rerun the relevant arm and
36
+ include the numbers (and their cost) in the PR.
pymelvil-0.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Harish Varma Siravuri
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: pymelvil
3
+ Version: 0.3.0
4
+ Summary: Optimized, versioned classifier prompts from labeled examples — GEPA prompt evolution with a classification-specific layer.
5
+ Project-URL: Homepage, https://github.com/harishsiravuri/melvil
6
+ Project-URL: Issues, https://github.com/harishsiravuri/melvil/issues
7
+ Author-email: Harish Varma Siravuri <harish.siravuri@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Harish Varma Siravuri
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Keywords: classification,dspy,gepa,llm,prompt-optimization
31
+ Classifier: Development Status :: 3 - Alpha
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Programming Language :: Python :: 3
35
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
36
+ Requires-Python: >=3.10
37
+ Requires-Dist: dspy>=3.0
38
+ Requires-Dist: gepa>=0.0.20
39
+ Requires-Dist: pyyaml>=6.0
40
+ Provides-Extra: dev
41
+ Requires-Dist: datasets>=3.0; extra == 'dev'
42
+ Requires-Dist: pytest>=8.0; extra == 'dev'
43
+ Requires-Dist: ruff>=0.6; extra == 'dev'
44
+ Provides-Extra: hf
45
+ Requires-Dist: datasets>=3.0; extra == 'hf'
46
+ Description-Content-Type: text/markdown
47
+
48
+ # melvil
49
+
50
+ **Labeled examples + a label taxonomy in → an optimized, versioned classifier prompt out.**
51
+
52
+ melvil wraps the [GEPA](https://github.com/gepa-ai/gepa) reflective prompt-evolution
53
+ engine with a classification-specific layer that generic prompt optimizers lack:
54
+ confusion-driven reflection, a per-label prompt codebook, and hard-example mining.
55
+ It is a pure Python library — the API is the product.
56
+
57
+ *Named for [Melvil Dewey](https://en.wikipedia.org/wiki/Melvil_Dewey), who gave
58
+ libraries a system for putting things in the right category.*
59
+
60
+ ```python
61
+ import melvil as mv
62
+
63
+ examples = mv.load_csv("tickets.csv") # text,label columns
64
+ train, dev = mv.train_dev_split(examples, dev_size=100, seed=0)
65
+ spec = mv.TaskSpec.from_examples("ticket-intents", examples)
66
+ cfg = mv.Config(task_model="openai/gpt-4.1-mini",
67
+ reflection_model="openai/gpt-4.1", budget="light")
68
+ artifact = mv.optimize(spec, train, dev, cfg)
69
+ print(artifact.render()) # deployable prompt string
70
+ artifact.save("ticket_intents.v1.json")
71
+ ```
72
+
73
+ ## Install
74
+
75
+ ```bash
76
+ pip install pymelvil # the PyPI distribution is `pymelvil`; you `import melvil`
77
+ pip install 'pymelvil[hf]' # + HuggingFace dataset loaders
78
+ ```
79
+
80
+ From a checkout:
81
+
82
+ ```bash
83
+ pip install -e '.[hf,dev]' # + test/lint tooling
84
+ ```
85
+
86
+ Model names are [LiteLLM](https://docs.litellm.ai) ids (`openai/...`,
87
+ `anthropic/...`, `openrouter/...`); set the matching API key env var
88
+ (`OPENAI_API_KEY`, `OPENROUTER_API_KEY`, ...).
89
+
90
+ ## What the benchmarks say (read this before choosing features)
91
+
92
+ We benchmark honestly, including against ourselves — full protocol and numbers in
93
+ [benchmarks/RESULTS.md](benchmarks/RESULTS.md). The pre-registered confirmation pass
94
+ (8 public datasets, fresh seeds, light budget, gpt-4.1-mini) found:
95
+
96
+ - **Vanilla GEPA over melvil's rendered prompt is the strongest configuration**
97
+ (mean test accuracy 0.781 vs 0.755 for the full classification layer and 0.762 for
98
+ MIPROv2; seed prompt 0.703). At light budgets, prefer `features=mv.Features.none()`.
99
+ - The classification layer's per-component updates trade whole-prompt coverage for
100
+ structure; at ~6–10 accepted proposals per run that trade loses, especially on hard
101
+ small-taxonomy tasks. Whether it wins at medium/heavy budgets is an open question.
102
+ - Hard-example mining, behind its (strict, quarantined) accept gate, kept exemplars in
103
+ 0/24 confirmation runs — treat it as a safety-gated no-op at light budgets.
104
+
105
+ ## What the classification layer does
106
+
107
+ Each feature is independently toggleable via `mv.Features` (**all off by default** — the default is the benchmark-strongest vanilla-GEPA configuration; enable the layer with `mv.Features.all()` or per-flag;
108
+ `Features.none()` is an explicit alias for the default):
109
+
110
+ 1. **Per-label codebook** — the prompt is not a free-text blob but named
111
+ components: a task instruction, one definition per label, and boundary
112
+ rules. GEPA evolves them per-component.
113
+ 2. **Confusion-driven reflection** — every full dev evaluation updates a
114
+ confusion matrix; reflection rounds are pointed at the label components on
115
+ both sides of the currently worst confused boundary, and the reflection LM
116
+ is shown the top confused pairs with concrete misclassified examples.
117
+ 3. **Hard-example mining** — dev examples that stay misclassified across the
118
+ run become candidate few-shot exemplars, selected to cover the top confused
119
+ boundaries, and kept only if they don't hurt dev accuracy. (Exemplars come
120
+ from dev, so dev scores of exemplar-augmented artifacts are mildly
121
+ optimistic — judge them on test.)
122
+
123
+ The rendered prompt always ends with a fixed, non-evolvable output-format
124
+ contract, so the optimizer can never break parseability.
125
+
126
+ ## Everything else you get
127
+
128
+ - **`PromptArtifact`** — versioned JSON: components, models, budget and cost
129
+ actually spent, dev scores + confusion matrix, the dev-score-vs-budget curve,
130
+ config hash, lineage (`parent_id`). `artifact.diff(other)` gives a
131
+ per-component diff with score deltas.
132
+ - **`evaluate(artifact, data, model=...)`** — accuracy, macro-F1, per-label
133
+ P/R/F1, confusion, cost; pass a different `model` for a transfer evaluation.
134
+ `report(...)` renders it as markdown.
135
+ - **Cost estimation before spending** — `estimate_optimize_cost(spec, train,
136
+ dev, cfg)` is a dry-run upper bound; measured spend comes from the LM call
137
+ history and lands in the artifact.
138
+ - **Run directories & resume** — every run writes `runs/<task>/<hash>-s<seed>/`
139
+ (config, engine state, reflection traces, artifact);
140
+ `optimize(..., resume=True)` continues an interrupted run.
141
+ - **Progress** — pass `on_round=lambda info: ...` for live dev score / spend
142
+ after every full dev evaluation, or just read the default logging.
143
+ - **Offline testing** — `melvil.testing` ships fake LMs with a real
144
+ optimization gradient; the whole test suite runs with no API keys.
145
+
146
+ ## Worked example & docs
147
+
148
+ - [examples/quickstart.py](examples/quickstart.py) — the snippet above, runnable end-to-end on AG News.
149
+ - [examples/agnews_demo.ipynb](examples/agnews_demo.ipynb) — notebook walkthrough with a live progress callback.
150
+ - [docs/api.md](docs/api.md) — public API reference.
151
+ - [benchmarks/](benchmarks/) — the honest-benchmark harness (datasets × arms × seeds).
152
+
153
+ ## Development
154
+
155
+ ```bash
156
+ pip install -e '.[dev]'
157
+ pytest # green with no API keys — fake-LM offline suite
158
+ ruff check .
159
+ ```
160
+
161
+ License: MIT.
@@ -0,0 +1,114 @@
1
+ # melvil
2
+
3
+ **Labeled examples + a label taxonomy in → an optimized, versioned classifier prompt out.**
4
+
5
+ melvil wraps the [GEPA](https://github.com/gepa-ai/gepa) reflective prompt-evolution
6
+ engine with a classification-specific layer that generic prompt optimizers lack:
7
+ confusion-driven reflection, a per-label prompt codebook, and hard-example mining.
8
+ It is a pure Python library — the API is the product.
9
+
10
+ *Named for [Melvil Dewey](https://en.wikipedia.org/wiki/Melvil_Dewey), who gave
11
+ libraries a system for putting things in the right category.*
12
+
13
+ ```python
14
+ import melvil as mv
15
+
16
+ examples = mv.load_csv("tickets.csv") # text,label columns
17
+ train, dev = mv.train_dev_split(examples, dev_size=100, seed=0)
18
+ spec = mv.TaskSpec.from_examples("ticket-intents", examples)
19
+ cfg = mv.Config(task_model="openai/gpt-4.1-mini",
20
+ reflection_model="openai/gpt-4.1", budget="light")
21
+ artifact = mv.optimize(spec, train, dev, cfg)
22
+ print(artifact.render()) # deployable prompt string
23
+ artifact.save("ticket_intents.v1.json")
24
+ ```
25
+
26
+ ## Install
27
+
28
+ ```bash
29
+ pip install pymelvil # the PyPI distribution is `pymelvil`; you `import melvil`
30
+ pip install 'pymelvil[hf]' # + HuggingFace dataset loaders
31
+ ```
32
+
33
+ From a checkout:
34
+
35
+ ```bash
36
+ pip install -e '.[hf,dev]' # + test/lint tooling
37
+ ```
38
+
39
+ Model names are [LiteLLM](https://docs.litellm.ai) ids (`openai/...`,
40
+ `anthropic/...`, `openrouter/...`); set the matching API key env var
41
+ (`OPENAI_API_KEY`, `OPENROUTER_API_KEY`, ...).
42
+
43
+ ## What the benchmarks say (read this before choosing features)
44
+
45
+ We benchmark honestly, including against ourselves — full protocol and numbers in
46
+ [benchmarks/RESULTS.md](benchmarks/RESULTS.md). The pre-registered confirmation pass
47
+ (8 public datasets, fresh seeds, light budget, gpt-4.1-mini) found:
48
+
49
+ - **Vanilla GEPA over melvil's rendered prompt is the strongest configuration**
50
+ (mean test accuracy 0.781 vs 0.755 for the full classification layer and 0.762 for
51
+ MIPROv2; seed prompt 0.703). At light budgets, prefer `features=mv.Features.none()`.
52
+ - The classification layer's per-component updates trade whole-prompt coverage for
53
+ structure; at ~6–10 accepted proposals per run that trade loses, especially on hard
54
+ small-taxonomy tasks. Whether it wins at medium/heavy budgets is an open question.
55
+ - Hard-example mining, behind its (strict, quarantined) accept gate, kept exemplars in
56
+ 0/24 confirmation runs — treat it as a safety-gated no-op at light budgets.
57
+
58
+ ## What the classification layer does
59
+
60
+ Each feature is independently toggleable via `mv.Features` (**all off by default** — the default is the benchmark-strongest vanilla-GEPA configuration; enable the layer with `mv.Features.all()` or per-flag;
61
+ `Features.none()` is an explicit alias for the default):
62
+
63
+ 1. **Per-label codebook** — the prompt is not a free-text blob but named
64
+ components: a task instruction, one definition per label, and boundary
65
+ rules. GEPA evolves them per-component.
66
+ 2. **Confusion-driven reflection** — every full dev evaluation updates a
67
+ confusion matrix; reflection rounds are pointed at the label components on
68
+ both sides of the currently worst confused boundary, and the reflection LM
69
+ is shown the top confused pairs with concrete misclassified examples.
70
+ 3. **Hard-example mining** — dev examples that stay misclassified across the
71
+ run become candidate few-shot exemplars, selected to cover the top confused
72
+ boundaries, and kept only if they don't hurt dev accuracy. (Exemplars come
73
+ from dev, so dev scores of exemplar-augmented artifacts are mildly
74
+ optimistic — judge them on test.)
75
+
76
+ The rendered prompt always ends with a fixed, non-evolvable output-format
77
+ contract, so the optimizer can never break parseability.
78
+
79
+ ## Everything else you get
80
+
81
+ - **`PromptArtifact`** — versioned JSON: components, models, budget and cost
82
+ actually spent, dev scores + confusion matrix, the dev-score-vs-budget curve,
83
+ config hash, lineage (`parent_id`). `artifact.diff(other)` gives a
84
+ per-component diff with score deltas.
85
+ - **`evaluate(artifact, data, model=...)`** — accuracy, macro-F1, per-label
86
+ P/R/F1, confusion, cost; pass a different `model` for a transfer evaluation.
87
+ `report(...)` renders it as markdown.
88
+ - **Cost estimation before spending** — `estimate_optimize_cost(spec, train,
89
+ dev, cfg)` is a dry-run upper bound; measured spend comes from the LM call
90
+ history and lands in the artifact.
91
+ - **Run directories & resume** — every run writes `runs/<task>/<hash>-s<seed>/`
92
+ (config, engine state, reflection traces, artifact);
93
+ `optimize(..., resume=True)` continues an interrupted run.
94
+ - **Progress** — pass `on_round=lambda info: ...` for live dev score / spend
95
+ after every full dev evaluation, or just read the default logging.
96
+ - **Offline testing** — `melvil.testing` ships fake LMs with a real
97
+ optimization gradient; the whole test suite runs with no API keys.
98
+
99
+ ## Worked example & docs
100
+
101
+ - [examples/quickstart.py](examples/quickstart.py) — the snippet above, runnable end-to-end on AG News.
102
+ - [examples/agnews_demo.ipynb](examples/agnews_demo.ipynb) — notebook walkthrough with a live progress callback.
103
+ - [docs/api.md](docs/api.md) — public API reference.
104
+ - [benchmarks/](benchmarks/) — the honest-benchmark harness (datasets × arms × seeds).
105
+
106
+ ## Development
107
+
108
+ ```bash
109
+ pip install -e '.[dev]'
110
+ pytest # green with no API keys — fake-LM offline suite
111
+ ruff check .
112
+ ```
113
+
114
+ License: MIT.
@@ -0,0 +1,8 @@
1
+ # Security Policy
2
+
3
+ melvil makes LLM API calls with keys read from environment variables; it never
4
+ stores or transmits keys elsewhere. Run directories and artifacts contain your
5
+ dataset text and model outputs — treat them with the same care as the data itself.
6
+
7
+ To report a vulnerability, email harish.siravuri@gmail.com rather than opening a
8
+ public issue. You should receive a response within a week.