pearmut 0.2.4__tar.gz → 0.2.5__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 (24) hide show
  1. {pearmut-0.2.4 → pearmut-0.2.5}/PKG-INFO +1 -1
  2. {pearmut-0.2.4 → pearmut-0.2.5}/pearmut.egg-info/PKG-INFO +1 -1
  3. {pearmut-0.2.4 → pearmut-0.2.5}/pyproject.toml +1 -1
  4. {pearmut-0.2.4 → pearmut-0.2.5}/server/app.py +16 -17
  5. {pearmut-0.2.4 → pearmut-0.2.5}/server/assignment.py +10 -10
  6. {pearmut-0.2.4 → pearmut-0.2.5}/server/static/dashboard.bundle.js +1 -1
  7. {pearmut-0.2.4 → pearmut-0.2.5}/server/static/dashboard.html +2 -1
  8. {pearmut-0.2.4 → pearmut-0.2.5}/server/static/listwise.bundle.js +1 -1
  9. {pearmut-0.2.4 → pearmut-0.2.5}/server/static/listwise.html +1 -1
  10. {pearmut-0.2.4 → pearmut-0.2.5}/server/static/pointwise.bundle.js +1 -1
  11. {pearmut-0.2.4 → pearmut-0.2.5}/server/static/pointwise.html +1 -1
  12. {pearmut-0.2.4 → pearmut-0.2.5}/LICENSE +0 -0
  13. {pearmut-0.2.4 → pearmut-0.2.5}/README.md +0 -0
  14. {pearmut-0.2.4 → pearmut-0.2.5}/pearmut.egg-info/SOURCES.txt +0 -0
  15. {pearmut-0.2.4 → pearmut-0.2.5}/pearmut.egg-info/dependency_links.txt +0 -0
  16. {pearmut-0.2.4 → pearmut-0.2.5}/pearmut.egg-info/entry_points.txt +0 -0
  17. {pearmut-0.2.4 → pearmut-0.2.5}/pearmut.egg-info/requires.txt +0 -0
  18. {pearmut-0.2.4 → pearmut-0.2.5}/pearmut.egg-info/top_level.txt +0 -0
  19. {pearmut-0.2.4 → pearmut-0.2.5}/server/cli.py +0 -0
  20. {pearmut-0.2.4 → pearmut-0.2.5}/server/static/assets/favicon.svg +0 -0
  21. {pearmut-0.2.4 → pearmut-0.2.5}/server/static/assets/style.css +0 -0
  22. {pearmut-0.2.4 → pearmut-0.2.5}/server/static/index.html +0 -0
  23. {pearmut-0.2.4 → pearmut-0.2.5}/server/utils.py +0 -0
  24. {pearmut-0.2.4 → pearmut-0.2.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pearmut
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: A tool for evaluation of model outputs, primarily MT.
5
5
  Author-email: Vilém Zouhar <vilem.zouhar@gmail.com>
6
6
  License: apache-2.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pearmut
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: A tool for evaluation of model outputs, primarily MT.
5
5
  Author-email: Vilém Zouhar <vilem.zouhar@gmail.com>
6
6
  License: apache-2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pearmut"
3
- version = "0.2.4"
3
+ version = "0.2.5"
4
4
  description = "A tool for evaluation of model outputs, primarily MT."
5
5
  readme = "README.md"
6
6
  license = { text = "apache-2.0" }
@@ -54,9 +54,9 @@ async def _log_response(request: LogResponseRequest):
54
54
  item_i = request.item_i
55
55
 
56
56
  if campaign_id not in progress_data:
57
- return JSONResponse(content={"error": "Unknown campaign ID"}, status_code=400)
57
+ return JSONResponse(content="Unknown campaign ID", status_code=400)
58
58
  if user_id not in progress_data[campaign_id]:
59
- return JSONResponse(content={"error": "Unknown user ID"}, status_code=400)
59
+ return JSONResponse(content="Unknown user ID", status_code=400)
60
60
 
61
61
  # append response to the output log
62
62
  save_db_payload(
@@ -86,7 +86,7 @@ async def _log_response(request: LogResponseRequest):
86
86
  progress_data, request.item_i, request.payload)
87
87
  save_progress_data(progress_data)
88
88
 
89
- return JSONResponse(content={"status": "ok"}, status_code=200)
89
+ return JSONResponse(content="ok", status_code=200)
90
90
 
91
91
 
92
92
  class NextItemRequest(BaseModel):
@@ -100,9 +100,9 @@ async def _get_next_item(request: NextItemRequest):
100
100
  user_id = request.user_id
101
101
 
102
102
  if campaign_id not in progress_data:
103
- return JSONResponse(content={"error": "Unknown campaign ID"}, status_code=400)
103
+ return JSONResponse(content="Unknown campaign ID", status_code=400)
104
104
  if user_id not in progress_data[campaign_id]:
105
- return JSONResponse(content={"error": "Unknown user ID"}, status_code=400)
105
+ return JSONResponse(content="Unknown user ID", status_code=400)
106
106
 
107
107
  return get_next_item(
108
108
  campaign_id,
@@ -125,9 +125,9 @@ async def _get_i_item(request: GetItemRequest):
125
125
  item_i = request.item_i
126
126
 
127
127
  if campaign_id not in progress_data:
128
- return JSONResponse(content={"error": "Unknown campaign ID"}, status_code=400)
128
+ return JSONResponse(content="Unknown campaign ID", status_code=400)
129
129
  if user_id not in progress_data[campaign_id]:
130
- return JSONResponse(content={"error": "Unknown user ID"}, status_code=400)
130
+ return JSONResponse(content="Unknown user ID", status_code=400)
131
131
 
132
132
  return get_i_item(
133
133
  campaign_id,
@@ -148,14 +148,14 @@ async def _dashboard_data(request: DashboardDataRequest):
148
148
  campaign_id = request.campaign_id
149
149
 
150
150
  if campaign_id not in progress_data:
151
- return JSONResponse(content={"error": "Unknown campaign ID"}, status_code=400)
151
+ return JSONResponse(content="Unknown campaign ID", status_code=400)
152
152
 
153
153
  is_privileged = (request.token == tasks_data[campaign_id]["token"])
154
154
 
155
155
  progress_new = {}
156
156
  assignment = tasks_data[campaign_id]["info"]["assignment"]
157
157
  if assignment not in ["task-based", "single-stream"]:
158
- return JSONResponse(content={"error": "Unsupported campaign assignment type"}, status_code=400)
158
+ return JSONResponse(content="Unsupported campaign assignment type", status_code=400)
159
159
 
160
160
  # Get threshold info for the campaign
161
161
  validation_threshold = tasks_data[campaign_id]["info"].get("validation_threshold")
@@ -184,7 +184,6 @@ async def _dashboard_data(request: DashboardDataRequest):
184
184
 
185
185
  return JSONResponse(
186
186
  content={
187
- "status": "ok",
188
187
  "data": progress_new,
189
188
  "validation_threshold": validation_threshold
190
189
  },
@@ -206,11 +205,11 @@ async def _reset_task(request: ResetTaskRequest):
206
205
  token = request.token
207
206
 
208
207
  if campaign_id not in progress_data:
209
- return JSONResponse(content={"error": "Unknown campaign ID"}, status_code=400)
208
+ return JSONResponse(content="Unknown campaign ID", status_code=400)
210
209
  if token != tasks_data[campaign_id]["token"]:
211
- return JSONResponse(content={"error": "Invalid token"}, status_code=400)
210
+ return JSONResponse(content="Invalid token", status_code=400)
212
211
  if user_id not in progress_data[campaign_id]:
213
- return JSONResponse(content={"error": "Unknown user ID"}, status_code=400)
212
+ return JSONResponse(content="Unknown user ID", status_code=400)
214
213
 
215
214
  response = reset_task(campaign_id, user_id, tasks_data, progress_data)
216
215
  save_progress_data(progress_data)
@@ -228,7 +227,7 @@ async def _download_annotations(
228
227
  for campaign_id in campaign_id:
229
228
  output_path = f"{ROOT}/data/outputs/{campaign_id}.jsonl"
230
229
  if campaign_id not in progress_data:
231
- return JSONResponse(content={"error": f"Unknown campaign ID {campaign_id}"}, status_code=400)
230
+ return JSONResponse(content=f"Unknown campaign ID {campaign_id}", status_code=400)
232
231
  if not os.path.exists(output_path):
233
232
  output[campaign_id] = []
234
233
  else:
@@ -245,14 +244,14 @@ async def _download_progress(
245
244
  ):
246
245
 
247
246
  if len(campaign_id) != len(token):
248
- return JSONResponse(content={"error": "Mismatched campaign_id and token count"}, status_code=400)
247
+ return JSONResponse(content="Mismatched campaign_id and token count", status_code=400)
249
248
 
250
249
  output = {}
251
250
  for i, cid in enumerate(campaign_id):
252
251
  if cid not in progress_data:
253
- return JSONResponse(content={"error": f"Unknown campaign ID {cid}"}, status_code=400)
252
+ return JSONResponse(content=f"Unknown campaign ID {cid}", status_code=400)
254
253
  if token[i] != tasks_data[cid]["token"]:
255
- return JSONResponse(content={"error": f"Invalid token for campaign ID {cid}"}, status_code=400)
254
+ return JSONResponse(content=f"Invalid token for campaign ID {cid}", status_code=400)
256
255
 
257
256
  output[cid] = progress_data[cid]
258
257
 
@@ -48,7 +48,7 @@ def get_next_item(
48
48
  elif assignment == "dynamic":
49
49
  return get_next_item_dynamic(campaign_id, user_id, tasks_data, progress_data)
50
50
  else:
51
- return JSONResponse(content={"error": "Unknown campaign assignment type"}, status_code=400)
51
+ return JSONResponse(content="Unknown campaign assignment type", status_code=400)
52
52
 
53
53
 
54
54
  def get_i_item(
@@ -67,7 +67,7 @@ def get_i_item(
67
67
  elif assignment == "single-stream":
68
68
  return get_i_item_singlestream(campaign_id, user_id, tasks_data, progress_data, item_i)
69
69
  else:
70
- return JSONResponse(content={"error": "Get item not supported for this assignment type"}, status_code=400)
70
+ return JSONResponse(content="Get item not supported for this assignment type", status_code=400)
71
71
 
72
72
 
73
73
  def get_i_item_taskbased(
@@ -90,7 +90,7 @@ def get_i_item_taskbased(
90
90
 
91
91
  if item_i < 0 or item_i >= len(data_all[campaign_id]["data"][user_id]):
92
92
  return JSONResponse(
93
- content={"status": "error", "message": "Item index out of range"},
93
+ content="Item index out of range",
94
94
  status_code=400
95
95
  )
96
96
 
@@ -133,7 +133,7 @@ def get_i_item_singlestream(
133
133
 
134
134
  if item_i < 0 or item_i >= len(data_all[campaign_id]["data"]):
135
135
  return JSONResponse(
136
- content={"status": "error", "message": "Item index out of range"},
136
+ content="Item index out of range",
137
137
  status_code=400
138
138
  )
139
139
 
@@ -280,7 +280,7 @@ def reset_task(
280
280
  })
281
281
  progress_data[campaign_id][user_id]["progress"] = [False] * num_items
282
282
  _reset_user_time(progress_data, campaign_id, user_id)
283
- return JSONResponse(content={"status": "ok"}, status_code=200)
283
+ return JSONResponse(content="ok", status_code=200)
284
284
  elif assignment == "single-stream":
285
285
  # Save reset markers for all items (shared pool)
286
286
  num_items = len(tasks_data[campaign_id]["data"])
@@ -294,9 +294,9 @@ def reset_task(
294
294
  for uid in progress_data[campaign_id]:
295
295
  progress_data[campaign_id][uid]["progress"] = [False] * num_items
296
296
  _reset_user_time(progress_data, campaign_id, user_id)
297
- return JSONResponse(content={"status": "ok"}, status_code=200)
297
+ return JSONResponse(content="ok", status_code=200)
298
298
  else:
299
- return JSONResponse(content={"status": "error", "message": "Reset not supported for this assignment type"}, status_code=400)
299
+ return JSONResponse(content="Reset not supported for this assignment type", status_code=400)
300
300
 
301
301
 
302
302
  def update_progress(
@@ -319,8 +319,8 @@ def update_progress(
319
319
  # progress all users
320
320
  for uid in progress_data[campaign_id]:
321
321
  progress_data[campaign_id][uid]["progress"][item_i] = True
322
- return JSONResponse(content={"status": "ok"}, status_code=200)
322
+ return JSONResponse(content="ok", status_code=200)
323
323
  elif assignment == "dynamic":
324
- return JSONResponse(content={"status": "error", "message": "Dynamic protocol logging not implemented yet."}, status_code=400)
324
+ return JSONResponse(content="Dynamic protocol logging not implemented yet.", status_code=400)
325
325
  else:
326
- return JSONResponse(content={"status": "error", "message": "Unknown campaign assignment type"}, status_code=400)
326
+ return JSONResponse(content="Unknown campaign assignment type", status_code=400)