document_id stringlengths 10 13 | lang stringclasses 8
values | source stringclasses 2
values | task stringclasses 2
values | document_class stringclasses 12
values | messages listlengths 3 3 |
|---|---|---|---|---|---|
pt_train_61 | pt | xfund | document classification | medical_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ninscricao: um formulário com que se inscreve ou cadastra uma... |
fr_train_102 | fr | xfund | information extraction | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nnom: le nom de famille d'... |
synthetic_13 | it | synthetic | document classification | questionnaire | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ndelega: un atto con cui una persona autorizza un'altra ad ag... |
zh_train_86 | zh | xfund | document classification | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n订单: 用于订购货物或服务并列明品名和数量的表格.\n医疗表格: 临床或健康相关的表格,如病史记录、处方或治疗同意书.\... |
en_train_41 | en | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nlocation: the location, s... |
synthetic_387 | en | synthetic | document classification | contract | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ncontract: an agreement between parties setting out mutual ob... |
fr_train_51 | fr | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\ntitre: le titre d'un docu... |
ja_train_34 | ja | xfund | document classification | certificate | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nアンケート: 意見や情報を集めるために回答者に示す一連の質問.\n請求書: 提供した物品や役務と支払うべき金額を記載して... |
synthetic_314 | ja | synthetic | information extraction | certificate | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n氏名: 本人の氏名.\n記入日: 日付.\n生年月... |
de_train_87 | de | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nname: der vollständige Na... |
fr_train_60 | fr | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nnom: le nom de famille d'... |
fr_train_127 | fr | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\npays: le nom d'un pays.\n... |
pt_train_7 | pt | xfund | information extraction | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nuf: a unidade federativa ... |
it_train_102 | it | xfund | information extraction | power_of_attorney | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nindirizzo: l'indirizzo st... |
pt_train_127 | pt | xfund | document classification | medical_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nrecibo: a prova de que um pagamento foi feito ou de que bens... |
ja_train_91 | ja | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n電話番号: 電話番号.\n"
},
{
... |
de_train_126 | de | xfund | document classification | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nantrag: ein Formular, mit dem eine Leistung, eine Genehmigun... |
ja_train_124 | ja | xfund | information extraction | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n続柄: 本人との続柄.\n"
},
{
... |
zh_train_119 | zh | xfund | information extraction | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n性别: 个人的性别.\n民族: 个人的民族.\n出... |
fr_train_13 | fr | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nnom: le nom de famille d'... |
zh_train_89 | zh | xfund | document classification | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n登记表: 用于登记或注册个人、单位或物品信息的表格.\n合同: 各方之间约定相互权利义务的协议,包括租赁和服务条款.\n... |
pt_train_13 | pt | xfund | information extraction | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\ncnpj: o número de inscriç... |
zh_train_63 | zh | xfund | document classification | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n证明书: 由主管机构出具、用以证明某项事实、资格或状态的文件.\n简历: 个人教育经历和工作经历的概要.\n调查问卷: ... |
es_train_142 | es | xfund | document classification | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nrecibo: la prueba de que se ha realizado un pago o de que se... |
synthetic_310 | ja | synthetic | information extraction | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n生年月日: 本人の生年月日.\nメールアドレス: ... |
it_train_34 | it | xfund | document classification | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nricevuta: la prova che un pagamento è stato eseguito o che d... |
synthetic_187 | fr | synthetic | information extraction | contract | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\ndate: une date.\niban: le... |
de_train_79 | de | xfund | information extraction | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nfirma: der eingetragene N... |
it_train_69 | it | xfund | document classification | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ndomanda: un modulo compilato per richiedere un beneficio, un... |
fr_train_22 | fr | xfund | document classification | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nquestionnaire: une série de questions adressées à un réponda... |
de_train_53 | de | xfund | information extraction | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nname: der vollständige Na... |
it_train_93 | it | xfund | document classification | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nordine: un modulo con cui si ordinano beni o servizi, con ar... |
fr_train_148 | fr | xfund | information extraction | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\ndate-debut: la date à laq... |
fr_train_0 | fr | xfund | document classification | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ndeclaration: une déclaration par laquelle le signataire atte... |
fr_train_75 | fr | xfund | document classification | power_of_attorney | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ncv: le récapitulatif de la formation et de l'expérience prof... |
synthetic_321 | ja | synthetic | information extraction | declaration | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n氏名: 本人の氏名.\n生年月日: 本人の生年月日... |
ja_train_23 | ja | xfund | information extraction | power_of_attorney | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n続柄: 本人との続柄.\n"
},
{
... |
en_train_135 | en | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\ndate: a date.\n"
},
{... |
en_train_84 | en | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\ndate: a date.\ndescriptio... |
it_train_65 | it | xfund | document classification | power_of_attorney | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ndomanda: un modulo compilato per richiedere un beneficio, un... |
ja_train_137 | ja | xfund | document classification | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n医療書式: 既往歴・処方・治療同意など、診療や健康に関する書式.\n申請書: 給付・許可・助成・入学などを申請するために... |
pt_train_131 | pt | xfund | document classification | contract | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ncontrato: um acordo entre as partes que estabelece obrigaçõe... |
ja_train_23 | ja | xfund | document classification | power_of_attorney | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n登録用紙: 個人・団体・物件を登録または届け出るために記入する書式.\n契約書: 当事者間の権利義務を定めた合意書。賃貸... |
ja_train_83 | ja | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n氏名: 本人の氏名.\n担当者名: 担当者の氏名.... |
fr_train_133 | fr | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nnom-complet: le nom compl... |
ja_train_71 | ja | xfund | document classification | medical_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n証明書: 機関が事実・資格・身分を証明するために発行する書面.\n医療書式: 既往歴・処方・治療同意など、診療や健康に関... |
it_train_63 | it | xfund | document classification | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nfattura: il documento con cui un fornitore addebita beni o s... |
zh_train_125 | zh | xfund | document classification | power_of_attorney | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n发票: 供应商就所提供货物或服务开具并载明应付金额的凭证.\n合同: 各方之间约定相互权利义务的协议,包括租赁和服务条款... |
en_train_51 | en | xfund | document classification | contract | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nquestionnaire: a set of questions put to a respondent to col... |
synthetic_298 | zh | synthetic | document classification | questionnaire | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n发票: 供应商就所提供货物或服务开具并载明应付金额的凭证.\n简历: 个人教育经历和工作经历的概要.\n订单: 用于订购... |
zh_train_43 | zh | xfund | information extraction | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n姓名: 个人的姓名.\n身份证号: 居民身份证号码... |
pt_train_75 | pt | xfund | document classification | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\npedido: um formulário para encomendar bens ou serviços, com ... |
de_train_59 | de | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nname: der vollständige Na... |
synthetic_264 | zh | synthetic | document classification | order_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n医疗表格: 临床或健康相关的表格,如病史记录、处方或治疗同意书.\n调查问卷: 向填写人提出的一组问题,用以收集意见或信... |
synthetic_283 | zh | synthetic | document classification | curriculum_vitae | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\n收据: 证明款项已支付或货物已收讫的凭证.\n订单: 用于订购货物或服务并列明品名和数量的表格.\n声明书: 签署人对所... |
es_train_2 | es | xfund | information extraction | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nedad: la edad de una pers... |
es_train_31 | es | xfund | document classification | application_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ncuestionario: un conjunto de preguntas dirigidas a una perso... |
synthetic_195 | fr | synthetic | document classification | receipt | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\nrecu: la preuve qu'un paiement a été effectué ou que des bie... |
it_train_92 | it | xfund | information extraction | declaration | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\ndata: una data.\nluogo: i... |
pt_train_47 | pt | xfund | document classification | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: document classification\nAssign the document to exactly one of the classes listed below. Answer with a JSON object of the form {\"class\": \"<class>\"}.\n\nClasses:\ninscricao: um formulário com que se inscreve ou cadastra uma... |
ja_train_8 | ja | xfund | information extraction | registration_form | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\n生年月日: 本人の生年月日.\n"
},
... |
pt_train_143 | pt | xfund | information extraction | certificate | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\ne-mail: um endereço de e-... |
it_train_101 | it | xfund | information extraction | null | [
{
"role": "system",
"content": "You are an expert document analysis model.\nTask: information extraction\nReturn a JSON object with exactly the keys listed below, in the same order. Every value must be copied verbatim from the document. Omit a key whose value is absent.\n\nSchema:\nluogo-nascita: il luogo (... |
xfund-docai-xl
An adaptation of XFUND for key information extraction and document classification DocAI tasks with augmented generated documents.
Note: Annotations and Synthetic documents have been generated by Claude Opus 5 under my supervision - but errors and biases may be here and there. The dataset is intended for experimenting with LLMs finetuning for DocAI. If you spot something odd and would like to contribute to improve the quality, feel free to open an issue!
Seven languages, two tasks, one prompt shape. 1 743 documents turned into 3 027 chat examples that teach a small model to (a) fill whatever JSON schema it is handed and (b) say what kind of document it is looking at — in Italian, German, Spanish, French, Portuguese, Chinese and Japanese.
Derived from XFUND plus 350 fabricated pages. Successor to xfund-kie-it (Italian, extraction only).
| train | val | |
|---|---|---|
| documents | 1 323 | 420 |
| extraction rows | 1 221 | 385 |
| classification rows | 1 083 | 338 |
1 393 XFUND pages (149 train + 50 val × 7 languages, its own split) and 350 generated pages (40 + 10 × 7). 9 105 extracted fields — 6 686 from XFUND, 2 419 synthetic — over 277 keys and 12 classes. A page contributes a row to each task it can answer, so most appear twice and 57 answer neither.
What is new here
- Seven languages, not one. The Italian label→key pipeline was rewritten as a per-language rule table; every language has its own key vocabulary.
- One language per document, throughout. Keys, their descriptions and the class
names are all in the document's own language.
xfund-kie-itnamed Italian keys and then explained them in English, which asks the model to switch language mid-prompt. - A second task. Document classification, sharing the system-prompt shape with extraction so one fine-tune teaches both.
- A cross-lingual index.
concepts.jsonmaps each language's key onto a shared concept (luogo-nascita,geburtsort,出生地→birthplace), so the same field can be scored across languages. 78 concepts, 23 of them present in five languages or more. The concept ids never reach the model. - Generated pages. 350 documents covering all 12 classes across 6 page layouts and 4 visual themes, shipped as HTML alongside the text.
Prompt shape
Both tasks open the same way, then diverge on one line.
You are an expert document analysis model.
Task: information extraction
Return a JSON object with exactly the keys listed below, in the same order. Every
value must be copied verbatim from the document. Omit a key whose value is absent.
Schema:
cognome: il cognome della persona.
nome: il nome di battesimo della persona.
data-nascita: la data di nascita della persona.
codice-fiscale: il codice fiscale di una persona o di un ente.
data-rilascio: la data di rilascio di un documento.
→ {"cognome": "VALLE", "nome": "LUISA", "data-nascita": "22/12/1977",
"codice-fiscale": "VAL6647338477433", "data-rilascio": "2/12/2019"} (it_val_0)
You are an expert document analysis model.
Task: document classification
Assign the document to exactly one of the classes listed below. Answer with a JSON
object of the form {"class": "<class>"}.
Classes:
領収書: 代金が支払われたこと、または物品を受領したことを示す書面.
委任状: 本人が代理人に手続きを委任することを示す書面.
… (all twelve, shuffled)
→ {"class": "委任状"}
Files
train.jsonl / val.jsonl |
the dataset: document_id, lang, task, source, document_class, messages |
schemas.json |
per language, key → description (both in that language) |
classes.json |
the 12 class ids, each with a name and gloss per language |
stats.json |
counts per language, split and class |
Synthetic documents carry document_id synthetic_0 … synthetic_349; XFUND pages keep
theirs (it_val_0). Images are not copied — documents/*.json points at ../xfund/.
How it was built
Extraction. XFUND ships grounded question→answer links: a label on the page points at
the value written next to it. rules.py maps the label surface form onto a key
(Codice Fis.:, cod. fiscale, C.F. → codice-fiscale), so every value is verbatim
page text and nothing is generated. Then, in order: a label linked to several answers is a
repeated field and cannot supply one value; a key asserted twice with different values is
ambiguous and leaves the page; a value that cannot have the field's shape (an email with no
@, an age that is a town) is a mis-drawn link and is dropped; a key seen fewer than four
times in train is neither learnable nor scoreable and leaves the schema. 26–46% of links map
to a key — the rest are instruction paragraphs, checkbox prompts and table headers.
Classification. XFUND has no class labels, so they are read off each page's own title
(Vollmacht → power_of_attorney, 登録用紙 → registration_form). 1 071 of 1 393 XFUND
pages state what they are; the other 322 are left out of the classification task rather than
guessed at. They stay in the extraction task.
Generated pages. One document is built once as a list of blocks, then rendered twice —
to the text the model reads and to an HTML page — so the two cannot drift. Everything in
them is invented: people, towns, companies, tax codes (right shape, wrong check character),
IBANs; email addresses are on example.<tld>. Rare classes are over-weighted, since
application and registration forms are 72% of what XFUND labels (57% once the generated
pages are added).
Rebuild and check, from local/:
python make_docai.py # writes xfund-docai-xl/
python verify_docai.py # re-reads it and checks it
Decisions worth knowing
- The schema lists exactly the keys the page answers, in the order it answers them. The lesson is mirror the schema you are given; at inference the caller supplies it. No distractor keys — so a score on this val split is an upper bound on a run where the caller does not already know which fields are present.
{"class": "<name>"}, not a dict of all classes with onetrue. Shorter, and it keeps both tasks answering with one JSON object. The full class list is always shown and shuffled per example, so position cannot predict the answer.telefonoandcellulareare separate keys (and their equivalents elsewhere).xfund-kie-itmerged them, which made every page carrying both ambiguous and dropped it.- Class ids are English, class names are not. The id is what
stats.jsonanddocument_classrecord; the model only ever sees the localized name.
Limitations
- Japanese is the thinnest — 27 keys, 3.1–3.8 fields per page. Japanese forms repeat 住所 and 氏名 for applicant, guarantor and agent, and the ambiguity rule correctly drops all of them.
- Class labels are heuristic, read from titles, not human-annotated. A title that lies about its document, or a class-word that appears in a subtitle, is mislabelled.
- Generated pages have no OCR noise; XFUND pages have plenty. A model trained on the mix should still be evaluated on scanned input.
- XFUND's links are hand-drawn and occasionally land on the wrong box. The shape guards catch what they can (a phone number that is a street), not what they cannot (a first name in the surname box).
Licence and attribution
Upstream: XFUND, https://github.com/doc-analysis/XFUND, CC BY-NC-SA 4.0. This is a modified derivative, so the same licence applies: CC BY-NC-SA 4.0, NonCommercial, ShareAlike. Keep the attribution if you publish this dataset or a model trained on it. The 350 generated pages are original to this dataset and released under the same terms for simplicity.
- Downloads last month
- 91