Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,75 @@
|
|
1 |
---
|
2 |
license: odc-by
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: odc-by
|
3 |
+
task_categories:
|
4 |
+
- token-classification
|
5 |
+
language:
|
6 |
+
- de
|
7 |
+
- en
|
8 |
+
- fr
|
9 |
+
tags:
|
10 |
+
- finance
|
11 |
+
pretty_name: 'Funds report token classification '
|
12 |
+
size_categories:
|
13 |
+
- n<1K
|
14 |
---
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
**F**unds **R**eport **F**ront **P**age **E**ntities (FRFPE) is a dataset for document understanding and token classification.
|
19 |
+
It contains 356 titles/front pages of annual and semi-annual reports as well as extracted text and annotations for five different token categories.
|
20 |
+
|
21 |
+
FRFPE serves as an example of how to train and evaluate multimodal models such as LayoutLM using the deepdoctection framework on a custom dataset.
|
22 |
+
|
23 |
+
FRFPE contains documents in three different languages
|
24 |
+
|
25 |
+
- english: 167
|
26 |
+
- german: 149
|
27 |
+
- french: 9
|
28 |
+
|
29 |
+
as well as the token categories:
|
30 |
+
|
31 |
+
- report_date (1096 samples) - reporting date of the report
|
32 |
+
- report_type (738 samples) - annual/semi-annual report
|
33 |
+
- umbrella (912 samples) - fund issued as umbrella
|
34 |
+
- fund_name (2122 samples) - Subfund, as part of an umbrella fund or standalone fund
|
35 |
+
- other (12903 samples) - None of the above categories
|
36 |
+
|
37 |
+
The annotations have been made to the best of our knowledge and belief, but there is no claim on correctness.
|
38 |
+
|
39 |
+
Some cursory notes:
|
40 |
+
|
41 |
+
- The images were created by converting PDF files. A resolution of 300 dpi was applied during the conversion.
|
42 |
+
- The text was extracted from the PDF file using PDFPlumber. In some cases the PDF contains embedded images, which in turn contain text, such as corporate names. These are not extracted and are therefore not taken into account.
|
43 |
+
- The annotation was carried out with the annotation tool Prodigy.
|
44 |
+
- The category `report_date` is self-explanatory. `report_type` was used to indicate whether the report is an annual semi-annual report or a report in a different cycle.
|
45 |
+
- `umbrella`/`fund_name` is the classification of any token that is part of a fund name that represents either an umbrella, subfund or individual fund.
|
46 |
+
The distinction between whether a fund represents an umbrella, or single fund is not always apparent from the context of the document, which makes the classification
|
47 |
+
particularly challenging. In order to remain correct in the annotation, information from the Bafin database was used for cases that could not be clarified from the context.
|
48 |
+
|
49 |
+
To explore the dataset we suggest to use **deep**doctection. Place the unzipped folder in the `**deep**doctection ~/.cache/datasets` folder.
|
50 |
+
|
51 |
+
|
52 |
+
```python
|
53 |
+
import deepdoctection as dd
|
54 |
+
from pathlib import Path
|
55 |
+
|
56 |
+
@dd.object_types_registry.register("ner_first_page")
|
57 |
+
class FundsFirstPage(dd.ObjectTypes):
|
58 |
+
|
59 |
+
report_date = "report_date"
|
60 |
+
umbrella = "umbrella"
|
61 |
+
report_type = "report_type"
|
62 |
+
fund_name = "fund_name"
|
63 |
+
|
64 |
+
dd.update_all_types_dict()
|
65 |
+
|
66 |
+
path = Path("~/.cache/datasets/fund_ar_front_page/40952248ba13ae8bfdd39f56af22f7d9_0.json")
|
67 |
+
|
68 |
+
page = dd.Page.from_file(path)
|
69 |
+
page.image = dd.load_image_from_file(path.parents[0] / "image" / page.file_name.replace("pdf","png"))
|
70 |
+
|
71 |
+
page.viz(interactive=True,show_words=True) # close interactive window with q
|
72 |
+
|
73 |
+
for word in page.words:
|
74 |
+
print(f"text: {word.characters}, token class: {word.token_class}")
|
75 |
+
```
|