Alexander Sanchez commited on
Commit
1dc4b48
·
1 Parent(s): aad1d52

caligraphy metadata added

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -160,7 +160,7 @@ def evaluar_par(htr_text: str, gt_text: str):
160
  return f"❌ Error: {e}"
161
 
162
 
163
- def add_to_corpus(htr_text: str, gt_text: str, doc_type: str, region: str, date: str):
164
  if not htr_text.strip() or not gt_text.strip():
165
  return "⚠ HTR y GT son obligatorios."
166
  try:
@@ -172,6 +172,7 @@ def add_to_corpus(htr_text: str, gt_text: str, doc_type: str, region: str, date:
172
  "type": doc_type or "desconocido",
173
  "region": region or "desconocida",
174
  "date": date or "",
 
175
  "corrections": [],
176
  "source": "user_added",
177
  }
@@ -278,6 +279,11 @@ with gr.Blocks(
278
  add_type = gr.Textbox(label="Document type", placeholder="notarial / judicial / eclesiastico")
279
  add_region = gr.Textbox(label="Region", placeholder="Castilla, Andalucía…")
280
  add_date = gr.Textbox(label="Date", placeholder="1542")
 
 
 
 
 
281
  btn_add = gr.Button("Add to corpus", variant="primary")
282
  add_out = gr.Markdown()
283
  btn_add.click(
 
160
  return f"❌ Error: {e}"
161
 
162
 
163
+ def add_to_corpus(htr_text: str, gt_text: str, doc_type: str, region: str, date: str, caligrafia: str):
164
  if not htr_text.strip() or not gt_text.strip():
165
  return "⚠ HTR y GT son obligatorios."
166
  try:
 
172
  "type": doc_type or "desconocido",
173
  "region": region or "desconocida",
174
  "date": date or "",
175
+ "caligrafia": caligrafia or "desconocida",
176
  "corrections": [],
177
  "source": "user_added",
178
  }
 
279
  add_type = gr.Textbox(label="Document type", placeholder="notarial / judicial / eclesiastico")
280
  add_region = gr.Textbox(label="Region", placeholder="Castilla, Andalucía…")
281
  add_date = gr.Textbox(label="Date", placeholder="1542")
282
+ add_caligrafia = gr.dropdown(
283
+ label="Caligrafía",
284
+ choices=["desconocida", "procesal", "encadenada", "italica"],
285
+ value="desconocida",
286
+ )
287
  btn_add = gr.Button("Add to corpus", variant="primary")
288
  add_out = gr.Markdown()
289
  btn_add.click(