Spaces:
Sleeping
Sleeping
change the markdown from olof and erik feedback
Browse files- helper/text/overview/changelog_roadmap/changelog.md +5 -4
- helper/text/overview/changelog_roadmap/roadmap.md +12 -8
- helper/text/overview/contributions/contributions.md +22 -16
- helper/text/overview/contributions/huminfra_image.md +3 -0
- helper/text/overview/contributions/riksarkivet_image.md +3 -0
- helper/text/overview/duplicate_api/duplicate.md +1 -1
- helper/text/overview/faq_discussion/discussion.md +3 -7
- helper/text/overview/faq_discussion/faq.md +3 -3
- helper/text/overview/htrflow/htrflow_col1.md +4 -3
- helper/text/overview/htrflow/htrflow_col2.md +5 -4
- helper/text/overview/htrflow/htrflow_tab2.md +1 -1
- helper/text/overview/htrflow/htrflow_tab3.md +1 -1
- helper/text/overview/htrflow/htrflow_tab4.md +2 -2
- helper/text/text_overview.py +1 -0
- tabs/overview_tab.py +10 -8
helper/text/overview/changelog_roadmap/changelog.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
## Changelog
|
2 |
|
3 |
-
|
|
|
|
|
4 |
|
5 |
#### Added
|
6 |
|
@@ -8,14 +10,13 @@
|
|
8 |
|
9 |
#### Fixed
|
10 |
|
11 |
-
- Fixed naming conventions of tabs in app
|
12 |
|
13 |
#### Changed
|
14 |
|
15 |
- Changed the layout in both Fast track and Stepwise to improve the UX
|
|
|
16 |
- Examples are viewed in the middle of the layout
|
17 |
- "Advanced settings" are initial hidden
|
18 |
|
19 |
-
#### Removed
|
20 |
-
|
21 |
- Removed **help** tab for now (documentation of Fast track and Stepwise will come in a later release)
|
|
|
1 |
## Changelog
|
2 |
|
3 |
+
All notable changes to HTRFLOW will be documented here.
|
4 |
+
|
5 |
+
### [0.0.1] - 2023-10-23
|
6 |
|
7 |
#### Added
|
8 |
|
|
|
10 |
|
11 |
#### Fixed
|
12 |
|
13 |
+
- Fixed naming conventions of tabs in app so they are more coherent with the code.
|
14 |
|
15 |
#### Changed
|
16 |
|
17 |
- Changed the layout in both Fast track and Stepwise to improve the UX
|
18 |
+
|
19 |
- Examples are viewed in the middle of the layout
|
20 |
- "Advanced settings" are initial hidden
|
21 |
|
|
|
|
|
22 |
- Removed **help** tab for now (documentation of Fast track and Stepwise will come in a later release)
|
helper/text/overview/changelog_roadmap/roadmap.md
CHANGED
@@ -1,23 +1,27 @@
|
|
1 |
## Roadmap
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
6 |
-
- Add support for TrOCR models as Text recognition model
|
7 |
|
8 |
-
|
9 |
|
10 |
-
-
|
11 |
|
12 |
-
-
|
13 |
|
|
|
14 |
- Package the code
|
15 |
- Add support for batch inference
|
16 |
- Start a collaborative open source project
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
19 |
|
20 |
- Table detection
|
21 |
- Different text layouts with multiple columns
|
22 |
|
23 |
-
- Add more endpoints for
|
|
|
1 |
## Roadmap
|
2 |
|
3 |
+
Our roadmap is where you can learn about what features we're working on. Have any questions or comments about items on the roadmap? See **Overview** > **FAQ & Discussion** for feedback or collaboration.
|
4 |
|
5 |
+
### Working on
|
|
|
6 |
|
7 |
+
- Release Training and Eval data on HuggingFace
|
8 |
|
9 |
+
- Add support for TrOCR models as Text recognition model:
|
10 |
|
11 |
+
- Train a TrOCR model specialized on Swedish historical handwritten text.
|
12 |
|
13 |
+
- Optimize the backend of the application:
|
14 |
- Package the code
|
15 |
- Add support for batch inference
|
16 |
- Start a collaborative open source project
|
17 |
|
18 |
+
### Backlog
|
19 |
+
|
20 |
+
- Initial document classifier
|
21 |
+
|
22 |
+
- Add support for Different segmentation strategies:
|
23 |
|
24 |
- Table detection
|
25 |
- Different text layouts with multiple columns
|
26 |
|
27 |
+
- Add more endpoints for rest api and add a more extensive documentation
|
helper/text/overview/contributions/contributions.md
CHANGED
@@ -1,27 +1,33 @@
|
|
1 |
-
##
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
6 |
|
7 |
-
|
8 |
-
- [Name/Organization]: Contributed [Name of Dataset] that greatly enhanced the performance of [Specify Model].
|
9 |
-
- [Name/Organization]: Generously shared [Name of Dataset] enabling us to refine [Specify Model].
|
10 |
-
- ... (continue listing contributors as necessary)
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
- ... (continue listing contributors as necessary)
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
22 |
|
23 |
-
|
24 |
|
25 |
-
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## HTRFLOW – Contributions
|
2 |
|
3 |
+
The AI models used in HTRFLOW is the result of a collaborative effort, involving the National Archives in both Sweden and Finland, in partnership with the Stockholm City Archives, Jämtlands läns fornskriftsällskap, citizen science volunteers and researchers from Stockholm and Uppsala Universities.
|
4 |
|
5 |
+
Several datasets have been created by participants through Citizen Science using the Handwritten Text Recognition (HTR) software, Transkribus, provided by [READ-COOP SCE](https://readcoop.eu/) .
|
6 |
|
7 |
+
### Archives used to train models for HTRFLOW
|
|
|
|
|
|
|
8 |
|
9 |
+
[Svea hovrätt (Renskrivna protokoll), 1713–1735](https://sok.riksarkivet.se/arkiv/H2hpDbNn14scxjzdWqAaJ1)
|
10 |
|
11 |
+
[Bergmästaren i Nora m fl bergslag (Hammartingsprotokoll), 1698–1765](https://sok.riksarkivet.se/arkiv/M5Fe2TT9rH6cxG02H087k3)
|
|
|
12 |
|
13 |
+
[Trolldomskommissionen, mainly 1670s](https://sok.riksarkivet.se/trolldomskommissionen)
|
14 |
|
15 |
+
[Bergskollegium, 1718–1758](https://sok.riksarkivet.se/arkiv/SMFky31ekQ80Qsk0UCZZE2)
|
16 |
|
17 |
+
[Jämtlands domsaga, 1647–1688](https://sok.riksarkivet.se/arkiv/2l4NYFT8rH6cxG02H087k3)
|
18 |
|
19 |
+
[Stockholms domkapitel, 1728–1759](https://sok.riksarkivet.se/arkiv/etg1tyeEaIPMBzKbUKTjw1)
|
20 |
|
21 |
+
[Politikollegiet, 1729–1759](https://sok.riksarkivet.se/arkiv/1lQnXIDiKaYxRLBlK1dGF3)
|
22 |
|
23 |
+
[Göteborgs poliskammare före 1900 (Detektiva polisens rapportböcker), 1868–1901](https://sok.riksarkivet.se/arkiv/oLTOi9yxweZJUG018W43t3)
|
24 |
+
|
25 |
+
[Renovated Court Records, the National Archives of Finland, 1800s](https://tuomiokirjat.kansallisarkisto.fi/)
|
26 |
+
|
27 |
+
### Ongoing research collaborations
|
28 |
+
|
29 |
+
[Transcription node Sweden – machine interpretation and citizen research combined](https://riksarkivet.se/forskning), Swedish National Archives and University of Gothenburg, funded by the Swedish National Heritage Board.
|
30 |
+
|
31 |
+
[Mapping the geographies of early modern mining knowledge. A digital history of the study tours of the Swedish Bureau of Mines, 1691–1826](https://www.idehist.uu.se/forskning/projekt/den-tidigmoderna-bergsvetenskapens-geografier), Uppsala University and Stockholm University, funded by the Swedish Research Council.
|
32 |
+
|
33 |
+
The Swedish National Archives' research and development on HTR is part of the Swedish national infrastructure Huminfra. [Click here](https://riksarkivet.se/huminfra) for more information.
|
helper/text/overview/contributions/huminfra_image.md
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
<a href="https://www.huminfra.se/">
|
2 |
+
<img src="https://github.com/Borg93/htr_gradio_file_placeholder/blob/main/Huminfra_logo.png?raw=true" width="17%" align="left" margin-right="100" />
|
3 |
+
</a>
|
helper/text/overview/contributions/riksarkivet_image.md
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
<a href="https://riksarkivet.se">
|
2 |
+
<img src="https://raw.githubusercontent.com/Borg93/Riksarkivet_docs/main/docs/assets/fav-removebg-preview.png" width="17%" align="right" margin-right="100" />
|
3 |
+
</a>
|
helper/text/overview/duplicate_api/duplicate.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
Please be aware of certain limitations when using the application:
|
4 |
|
5 |
-
-
|
6 |
- Currently, the Swedish National Archives has constraints on sharing hardware, leading to a queue system for high demand.
|
7 |
- The demo is hosted on Hugging Face domains, and they may rate-limit you if there's an excessive number of requests in a short timeframe, especially when using the API.
|
8 |
|
|
|
2 |
|
3 |
Please be aware of certain limitations when using the application:
|
4 |
|
5 |
+
- This application is primarily designed for demonstration purposes and is not intended for scaling up HTR.
|
6 |
- Currently, the Swedish National Archives has constraints on sharing hardware, leading to a queue system for high demand.
|
7 |
- The demo is hosted on Hugging Face domains, and they may rate-limit you if there's an excessive number of requests in a short timeframe, especially when using the API.
|
8 |
|
helper/text/overview/faq_discussion/discussion.md
CHANGED
@@ -1,11 +1,7 @@
|
|
1 |
-
##
|
2 |
|
3 |
-
If you have
|
4 |
|
5 |
- Open a discussion on [HuggingFace](https://huggingface.co/spaces/Riksarkivet/htr_demo/discussions).
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
If you prefer email or your question is more sensitive please email.
|
10 |
-
|
11 |
-
- Send it to [email protected]
|
|
|
1 |
+
## Contact us
|
2 |
|
3 |
+
If you have any questions, or suggestions for features or improvements, please don’t hesitate to contact us.
|
4 |
|
5 |
- Open a discussion on [HuggingFace](https://huggingface.co/spaces/Riksarkivet/htr_demo/discussions).
|
6 |
|
7 |
+
- Send an email to: [email protected]
|
|
|
|
|
|
|
|
helper/text/overview/faq_discussion/faq.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
**A**: This is due to hardware constraints and rate limits imposed by Hugging Face. For alternative ways to use the app, refer to the tab > **Documentation** under > **Duplication for Own Use & API**.
|
8 |
|
9 |
**Q**: <u>Why is Fast track so slow?</u>
|
10 |
-
**A**: The current speed is due to hardware limitations and the present state of the code. However, we plan to update the application in future releases, which
|
11 |
|
12 |
-
**Q**: <u>Is possible to run Fast track or the API on
|
13 |
-
**A**: Not currently, but we plan to
|
|
|
7 |
**A**: This is due to hardware constraints and rate limits imposed by Hugging Face. For alternative ways to use the app, refer to the tab > **Documentation** under > **Duplication for Own Use & API**.
|
8 |
|
9 |
**Q**: <u>Why is Fast track so slow?</u>
|
10 |
+
**A**: The current speed is due to hardware limitations and the present state of the code. However, we plan to update the application in future releases, which till significantly improve the performance of the application.
|
11 |
|
12 |
+
**Q**: <u>Is it possible to run Fast track or the API on image batches?</u>
|
13 |
+
**A**: Not currently, but we plan to implement this feature in the future.
|
helper/text/overview/htrflow/htrflow_col1.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
## Introduction
|
2 |
|
3 |
-
The Swedish National Archives introduces a demonstrational end-to-end HTR (Handwritten Text Recognition) pipeline.
|
4 |
|
5 |
## Usage
|
6 |
|
7 |
-
It
|
|
|
8 |
|
9 |
For an insight into the upcoming features we are working on:
|
10 |
|
11 |
-
- Navigate to the > **
|
|
|
1 |
## Introduction
|
2 |
|
3 |
+
The Swedish National Archives introduces a demonstrational end-to-end HTR (Handwritten Text Recognition) pipeline. The pipeline consists of two instance segmentation models, one trained for segmenting text-regions within running-text document images, and another trained for segmenting text-lines within these regions. The text-lines are then transcribed by a text-recognition model trained on a vast set of swedish handwriting ranging from the 17th to the 19th century.
|
4 |
|
5 |
## Usage
|
6 |
|
7 |
+
It needs to be emphasized that this application is intended mainly for demo-purposes. It’s aim is to showcase our pipeline for transcribing historical, running-text documents, not to put the pipeline into large-scale production.
|
8 |
+
**Note**: In the future we’ll optimize the code to suit a production scenario with multi-GPU, batch-inference, but this is still a work in progress. <br>
|
9 |
|
10 |
For an insight into the upcoming features we are working on:
|
11 |
|
12 |
+
- Navigate to the > **Overview** > **Changelog & Roadmap**.
|
helper/text/overview/htrflow/htrflow_col2.md
CHANGED
@@ -2,12 +2,13 @@
|
|
2 |
|
3 |
Please fork and leave a star on Github if you like it! The code for this project can be found here:
|
4 |
|
5 |
-
- [Github](https://github.com/
|
6 |
-
|
|
|
7 |
|
8 |
## Models
|
9 |
|
10 |
-
The models
|
11 |
|
12 |
- [Riksarkivet/rtmdet_regions](https://huggingface.co/Riksarkivet/rtmdet_regions)
|
13 |
- [Riksarkivet/rtmdet_lines](https://huggingface.co/Riksarkivet/rtmdet_lines)
|
@@ -15,7 +16,7 @@ The models within this pipeline will be subject to continual retraining and upda
|
|
15 |
|
16 |
## Datasets
|
17 |
|
18 |
-
|
19 |
|
20 |
- [Riksarkivet/placeholder_region_segmentation](https://huggingface.co/datasets/Riksarkivet/placeholder_region_segmentation)
|
21 |
- [Riksarkivet/placeholder_line_segmentation](https://huggingface.co/datasets/Riksarkivet/placeholder_line_segmentation)
|
|
|
2 |
|
3 |
Please fork and leave a star on Github if you like it! The code for this project can be found here:
|
4 |
|
5 |
+
- [Github](https://github.com/Riksarkivet/HTRFLOW)
|
6 |
+
|
7 |
+
**Note**: We will in the future package all of the code for mass htr (batch inference on multi-GPU setup), but the code is still work in progress.
|
8 |
|
9 |
## Models
|
10 |
|
11 |
+
The models used in this demo are very much a work in progress, and as more data, and new architectures, becomes available, they will be retrained and reevaluated. For more information about the models, please refer to their model-cards on Huggingface.
|
12 |
|
13 |
- [Riksarkivet/rtmdet_regions](https://huggingface.co/Riksarkivet/rtmdet_regions)
|
14 |
- [Riksarkivet/rtmdet_lines](https://huggingface.co/Riksarkivet/rtmdet_lines)
|
|
|
16 |
|
17 |
## Datasets
|
18 |
|
19 |
+
Train and testsets created by the Swedish National Archives will be released here:
|
20 |
|
21 |
- [Riksarkivet/placeholder_region_segmentation](https://huggingface.co/datasets/Riksarkivet/placeholder_region_segmentation)
|
22 |
- [Riksarkivet/placeholder_line_segmentation](https://huggingface.co/datasets/Riksarkivet/placeholder_line_segmentation)
|
helper/text/overview/htrflow/htrflow_tab2.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
### Text-region segmentation
|
2 |
|
3 |
-
To facilitate the text-line segmentation process, it is advantageous to segment the image into text-regions beforehand. This initial step offers several benefits, including reducing variations in line spacing, eliminating blank areas on the page, establishing a clear reading order, and distinguishing marginalia from the main text. The segmentation model utilized in this process predicts both bounding boxes and masks. Although the model has the capability to predict both, only the masks are utilized for the segmentation tasks of lines and regions. An essential post-processing step involves checking for regions that are contained within other regions. During this step, only the containing region is retained, while the contained region is discarded. This ensures that the final segmented text-regions are accurate and devoid of overlapping or redundant areas.
|
4 |
|
5 |
<figure>
|
6 |
<img src="https://github.com/Borg93/htr_gradio_file_placeholder/blob/main/app_project_region.png?raw=true" alt="HTR_tool" style="width:70%; display: block; margin-left: auto; margin-right:auto;" >
|
|
|
1 |
### Text-region segmentation
|
2 |
|
3 |
+
To facilitate the text-line segmentation process, it is advantageous to segment the image into text-regions beforehand. This initial step offers several benefits, including reducing variations in line spacing, eliminating blank areas on the page, establishing a clear reading order, and distinguishing marginalia from the main text. The segmentation model utilized in this process predicts both bounding boxes and masks. Although the model has the capability to predict both, only the masks are utilized for the segmentation tasks of lines and regions. An essential post-processing step involves checking for regions that are contained within other regions. During this step, only the containing region is retained, while the contained region is discarded. This ensures that the final segmented text-regions are accurate and devoid of overlapping or redundant areas. This ensures that there’s no duplicate text-regions sent to the text-recognition model.
|
4 |
|
5 |
<figure>
|
6 |
<img src="https://github.com/Borg93/htr_gradio_file_placeholder/blob/main/app_project_region.png?raw=true" alt="HTR_tool" style="width:70%; display: block; margin-left: auto; margin-right:auto;" >
|
helper/text/overview/htrflow/htrflow_tab3.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
### Text-line segmentation
|
2 |
|
3 |
-
This is also an
|
4 |
|
5 |
<figure>
|
6 |
<img src="https://github.com/Borg93/htr_gradio_file_placeholder/blob/main/app_project_line.png?raw=true" alt="HTR_tool" style="width:70%; display: block; margin-left: auto; margin-right:auto;" >
|
|
|
1 |
### Text-line segmentation
|
2 |
|
3 |
+
This is also an instance segmentation model, trained on extracting text-lines from the cropped text-regions. The same post-processing as in the text-region segmentation step, is done in the text-line segmentation step.
|
4 |
|
5 |
<figure>
|
6 |
<img src="https://github.com/Borg93/htr_gradio_file_placeholder/blob/main/app_project_line.png?raw=true" alt="HTR_tool" style="width:70%; display: block; margin-left: auto; margin-right:auto;" >
|
helper/text/overview/htrflow/htrflow_tab4.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
###
|
2 |
|
3 |
-
|
4 |
|
5 |
<figure>
|
6 |
<img src="https://github.com/Borg93/htr_gradio_file_placeholder/blob/main/app_project_htr.png?raw=true" alt="HTR_tool" style="width:70%; display: block; margin-left: auto; margin-right:auto;" >
|
|
|
1 |
+
### Text Recognition
|
2 |
|
3 |
+
The text-recognition model was trained on approximately one million handwritten text-line images ranging from the 17th to the 19th century. See the model card for detailed evaluation results, and results from some fine-tuning experiments.
|
4 |
|
5 |
<figure>
|
6 |
<img src="https://github.com/Borg93/htr_gradio_file_placeholder/blob/main/app_project_htr.png?raw=true" alt="HTR_tool" style="width:70%; display: block; margin-left: auto; margin-right:auto;" >
|
helper/text/text_overview.py
CHANGED
@@ -17,6 +17,7 @@ class TextOverview:
|
|
17 |
|
18 |
# Contributions
|
19 |
contributions = read_markdown("helper/text/overview/contributions/contributions.md")
|
|
|
20 |
|
21 |
# Changelog & Roadmap
|
22 |
changelog = read_markdown("helper/text/overview/changelog_roadmap/changelog.md")
|
|
|
17 |
|
18 |
# Contributions
|
19 |
contributions = read_markdown("helper/text/overview/contributions/contributions.md")
|
20 |
+
huminfra_image = read_markdown("helper/text/overview/contributions/huminfra_image.md")
|
21 |
|
22 |
# Changelog & Roadmap
|
23 |
changelog = read_markdown("helper/text/overview/changelog_roadmap/changelog.md")
|
tabs/overview_tab.py
CHANGED
@@ -23,16 +23,11 @@ with gr.Blocks() as overview:
|
|
23 |
with gr.Tab("Text recognition"):
|
24 |
gr.Markdown(TextOverview.htrflow_tab4)
|
25 |
|
26 |
-
with gr.Tab("FAQ & Discussion"):
|
27 |
-
with gr.Row():
|
28 |
-
with gr.Column():
|
29 |
-
gr.Markdown(TextOverview.text_faq)
|
30 |
-
with gr.Column():
|
31 |
-
gr.Markdown(TextOverview.text_discussion)
|
32 |
-
|
33 |
with gr.Tab("Contributions"):
|
34 |
with gr.Row():
|
35 |
-
gr.
|
|
|
|
|
36 |
|
37 |
with gr.Tab("Duplicating for own use & API"):
|
38 |
with gr.Row():
|
@@ -63,3 +58,10 @@ with gr.Blocks() as overview:
|
|
63 |
gr.Markdown(TextOverview.changelog)
|
64 |
with gr.Column():
|
65 |
gr.Markdown(TextOverview.roadmap)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
with gr.Tab("Text recognition"):
|
24 |
gr.Markdown(TextOverview.htrflow_tab4)
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
with gr.Tab("Contributions"):
|
27 |
with gr.Row():
|
28 |
+
with gr.Column():
|
29 |
+
gr.Markdown(TextOverview.contributions)
|
30 |
+
gr.Markdown(TextOverview.huminfra_image)
|
31 |
|
32 |
with gr.Tab("Duplicating for own use & API"):
|
33 |
with gr.Row():
|
|
|
58 |
gr.Markdown(TextOverview.changelog)
|
59 |
with gr.Column():
|
60 |
gr.Markdown(TextOverview.roadmap)
|
61 |
+
|
62 |
+
with gr.Tab("FAQ & Discussion"):
|
63 |
+
with gr.Row():
|
64 |
+
with gr.Column():
|
65 |
+
gr.Markdown(TextOverview.text_faq)
|
66 |
+
with gr.Column():
|
67 |
+
gr.Markdown(TextOverview.text_discussion)
|