SlideShare a Scribd company logo
1 of 1
Download to read offline
Text::Perfide::BookCleaner,
                                           a Perl module to clean and normalize plain text books
                                                                                           Andr´ Santos, Jos´ Jo˜o Almeida
                                                                                               e            e a

                                                                                                                                     Table 2: Example excerpt before and after processed with sections
 Abstract                                                                                                    1 PRIMEIRA PARTE
                                                                                                                                                                         1 _sec+N:part=1_ PRIMEIRA PARTE
   Several tasks which include text documents processing, such as text alignment, format                     2
                                                                                                                                                                         2
                                                                                                             3 FANTINE
 conversions or information retrieval are heavily affected by the state of the original docu-                 4
                                                                                                                                                                         3 FANTINE
                                                                                                                                                                         4
 ments.                                                                                                      5
                                                                                                                                                                         5 _sec+N:book=1_ LIVRO PRIMEIRO
                                                                                                             6   ^L LIVRO PRIMEIRO
   Text::Perfide::BookCleaner is a Perl module to pre-process plain text books and                                                                                       6
                                                                                                             7                                                       ⇒7      UM JUSTO
 clean them, getting them prepared for further arbitrary use.                                                8 UM JUSTO
                                                                                                                                                                         8
   Cleaning tasks include removing page breaks, page numbers, headers and footers; find-                      9
                                                                                                                                                                         9 O abade Myriel
                                                                                                            10 O abade Myriel
 ing section titles and boundaries; removing footnotes and normalizing paragraph notation                   11
                                                                                                                                                                        10
                                                                                                                                                                        11 Em 1815, era bispo de Digne, o
 and Unicode characters. The process is guided with the help of declarative objects such as                 12 Em 1815, era bispo de Digne, o
                                                                                                                                                                        12 reverendo Carlos Francisco Bemvindo
                                                                                                            13 reverendo Carlos Francisco Bemvindo
 ontologies and configuration files.

                                                                                                            2.3        Paragraphs
1        Motivation                                                                                           Several possible notations for paragraphs:
 Text processing (and particularly book alignment) are tasks whose perfor-                                  new-line separated, blank-line separated,                        Algorithm
mance is often negatively affected by:                                                                       indented or not. Direct speech can also be                       Function paragraphs(text){
                                                                                                                                                                               Calculate text’s word and
                                                                                                            delimited with quotation marks or preceded
                                                                                                                                                                                 line metrics
        • Page structure                                        • Paragraphs                                with a dash.                                                       Find paragraph notation
        • Section titles and boundaries                         • Character encoding etc.                     Some metrics based on the number of                              Normalize paragraph notation
        • Footnotes                                                                                         words, white spaces, empty and non-empty                         }
                                                                                                            lines can be used to infer the type of no-
                                                                                                            tation used, which can then be normalized.
2        Book cleaner
                                                                                                            2.4        Footnotes
                                                                                                              Footnotes are formed by a call mark in the
                                                                                                            middle of the text, and the matching foot-                       Algorithm
                                                                                                            note expansion, which generally appears at                       Function footnotes(text)
                                                                                                                                                                               lines = lines from text
                                                                                                            the end of the same page.
                                                                                                                                                                               fnpattern = <<int>>, [int], ^int, ...
                                                                                                              Footnote expansions can often be found                           for ( x ∈ dom(lines)
                                                                                                            at the bottom of the page or, sometimes, at                              : x begins with fnpattern
                                                                                                            the end of the document.                                                 ∧ x is immediately before or
                                                                                                                                                                                         after page break ){
                                                                                                              Footnote call marks appear in the middle                           Replace x in text with custom mark
                                                                                                            of the text, usually consisting of some kind                         Add x to standoff file
                                                                                                            of numeration highlighted by some special                          }
                                                                                                            symbol.                                                            for ( y ∈ text : y ∈ fnpattern ){
                                                                                                                                                                                 Replace y in text with custom mark
                                                                                                                                                                                 Add y to standoff file
                                                                                                                                                                               }
                                                                                                                                                                             }

                                                                                                                                     Table 3: Example excerpt before and after processed with footnotes

                                                                                                             1   aupr`s de la rue Saint-Antoine,
                                                                                                                     e
2.1         Pages                                                                                            2   a la porte des Tournelles[1].
                                                                                                                 `
                                                                                                                                                                         1   aupr`s de la rue Saint-Antoine, a
                                                                                                                                                                                 e                            `
 Structural elements left from a document’s previous page division: page breaks, page num-
                                                                                                             3   [1] La Bastille, qui fut prise par le                   2   la porte des Tournelles_fnr29_.
bers, headers and footers.                                                                                   4   peuple de Paris, le 14 juillet 1789,                ⇒3      _fne8_
     Algorithm                                                                                               5   puis d´molie. B.
                                                                                                                       e                                                 4   ^L Quel etait en chemin l’´tonnement
                                                                                                                                                                                     ´                 e
       Function pages(text){                                                                                                                                             5   de l’Ing´nu! je vous le laisse a
                                                                                                                                                                                     e                       `
         page breaks = { page break characters ∪ page numbers }                                              6   ^L Quel etait en chemin l’´tonnement
                                                                                                                         ´                 e
         for ( x ∈ { page breaks }){
                                                                                                             7    de l’Ing´nu! je vous le laisse a
                                                                                                                           e                     `
            prec ← lines preceding x ; footers = footers ∪ { prec }
            foll ← lines following x ; headers = headers ∪ { foll }
         }
         Ignore headers/footers with number of occurrences < threshold
                                                                                                            2.5        Words and characters
         for ( y ∈ { headers ∪ footers }){                                                                   Sanitizing elements such as:
            Replace headers/footers with custom mark
            Add headers/footers to standoff file                                                                           • Unicode characters                              • Translineation
         }
       }                                                                                                                   • Text encoding                                   • Transpagination
                                                                                                                           • Glyphs
                          Table 1: Example excerpt before and after processed with pages

 1   le nabab, et assez audacieux                                                                           2.6        Commit
 2   pour s’emparer de sa personne.                                                                           Final step, which irreversibly removes all marks left behind by the previous steps and
 3                                                          1   le nabab, et assez audacieux                outputs the clean version of the text.
 4          Page 3                                          2   pour s’emparer de sa personne. _pb2_
 5   ^L La maison a vapeur Jules Verne
                  `
                                                        ⇒3        Le faquir, - evidemment le seul
                                                                               ´
 6                                                          4   entre tous que ne surexcitˆt pas
                                                                                          a                 3        Sections Ontology
 7     Le faquir, - evidemment le seul
                    ´                                                                                         An ontology is used to store information relevant to the sectioning process: types of sec-
 8   entre tous que ne surexcitˆt pas
                               a                                                                            tions and their relations, common section names, and ordinal and cardinal numbers. Each
                                                                                                            element in the ontology is translated to several different languages.
2.2         Sections                                                                                                                           Table 4: Excerpts from the sections ontology.

  Delimiting sections allows to:                                                                                 cap                       cena                         end                           3
                                                                Algorithm                                        PT cap´tulo, cap,
                                                                                                                        ı                  PT cena                      PT fim                        PT terceiro,
 • automatically generate tables of con-                                                                             capitulo              FR sc`ne
                                                                                                                                                e                       FR fin                           terceira,
                                                                  Function sections(text,ontology){
   tents;                                                           lines = lines from text                      FR chapitre, chap         EN scene                     EN the_end                       trˆs, tres
                                                                                                                                                                                                           e
 • identify sections from one version of a                          for ( x ∈ lines: x ∈ ontology ){             EN chapter, chap          BT act                       BT _alone                     EN third, three
   book that are missing on another ver-                              Add mark to text (before x)                RU глава                                                                             FR troisi`me,
                                                                                                                                                                                                               e
   sion;                                                            }                                            NT sec                                                                                  troisieme
 • matching and comparing the sections                            }                                                                                                                                   BT _numeral
   of two books before aligning them
                                                                                                             • ontology is being used to directly create the Perl code containing the complex data struc-
   (alignability);
                                                                                                               tures which are used in the process of sectioning;
 • perform additional processing on specific
                                                                                                             • the code is more readable and easier to maintain;
   sections.
                                                                                                             • the ontology can be used to discuss details with people with no programming experience.

                                                                                            http://per-fide.di.uminho.pt/

More Related Content

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Poster - Text::Perfide::BookCleaner, a Perl module to clean and normalize plain text books

  • 1. Text::Perfide::BookCleaner, a Perl module to clean and normalize plain text books Andr´ Santos, Jos´ Jo˜o Almeida e e a Table 2: Example excerpt before and after processed with sections Abstract 1 PRIMEIRA PARTE 1 _sec+N:part=1_ PRIMEIRA PARTE Several tasks which include text documents processing, such as text alignment, format 2 2 3 FANTINE conversions or information retrieval are heavily affected by the state of the original docu- 4 3 FANTINE 4 ments. 5 5 _sec+N:book=1_ LIVRO PRIMEIRO 6 ^L LIVRO PRIMEIRO Text::Perfide::BookCleaner is a Perl module to pre-process plain text books and 6 7 ⇒7 UM JUSTO clean them, getting them prepared for further arbitrary use. 8 UM JUSTO 8 Cleaning tasks include removing page breaks, page numbers, headers and footers; find- 9 9 O abade Myriel 10 O abade Myriel ing section titles and boundaries; removing footnotes and normalizing paragraph notation 11 10 11 Em 1815, era bispo de Digne, o and Unicode characters. The process is guided with the help of declarative objects such as 12 Em 1815, era bispo de Digne, o 12 reverendo Carlos Francisco Bemvindo 13 reverendo Carlos Francisco Bemvindo ontologies and configuration files. 2.3 Paragraphs 1 Motivation Several possible notations for paragraphs: Text processing (and particularly book alignment) are tasks whose perfor- new-line separated, blank-line separated, Algorithm mance is often negatively affected by: indented or not. Direct speech can also be Function paragraphs(text){ Calculate text’s word and delimited with quotation marks or preceded line metrics • Page structure • Paragraphs with a dash. Find paragraph notation • Section titles and boundaries • Character encoding etc. Some metrics based on the number of Normalize paragraph notation • Footnotes words, white spaces, empty and non-empty } lines can be used to infer the type of no- tation used, which can then be normalized. 2 Book cleaner 2.4 Footnotes Footnotes are formed by a call mark in the middle of the text, and the matching foot- Algorithm note expansion, which generally appears at Function footnotes(text) lines = lines from text the end of the same page. fnpattern = <<int>>, [int], ^int, ... Footnote expansions can often be found for ( x ∈ dom(lines) at the bottom of the page or, sometimes, at : x begins with fnpattern the end of the document. ∧ x is immediately before or after page break ){ Footnote call marks appear in the middle Replace x in text with custom mark of the text, usually consisting of some kind Add x to standoff file of numeration highlighted by some special } symbol. for ( y ∈ text : y ∈ fnpattern ){ Replace y in text with custom mark Add y to standoff file } } Table 3: Example excerpt before and after processed with footnotes 1 aupr`s de la rue Saint-Antoine, e 2.1 Pages 2 a la porte des Tournelles[1]. ` 1 aupr`s de la rue Saint-Antoine, a e ` Structural elements left from a document’s previous page division: page breaks, page num- 3 [1] La Bastille, qui fut prise par le 2 la porte des Tournelles_fnr29_. bers, headers and footers. 4 peuple de Paris, le 14 juillet 1789, ⇒3 _fne8_ Algorithm 5 puis d´molie. B. e 4 ^L Quel etait en chemin l’´tonnement ´ e Function pages(text){ 5 de l’Ing´nu! je vous le laisse a e ` page breaks = { page break characters ∪ page numbers } 6 ^L Quel etait en chemin l’´tonnement ´ e for ( x ∈ { page breaks }){ 7 de l’Ing´nu! je vous le laisse a e ` prec ← lines preceding x ; footers = footers ∪ { prec } foll ← lines following x ; headers = headers ∪ { foll } } Ignore headers/footers with number of occurrences < threshold 2.5 Words and characters for ( y ∈ { headers ∪ footers }){ Sanitizing elements such as: Replace headers/footers with custom mark Add headers/footers to standoff file • Unicode characters • Translineation } } • Text encoding • Transpagination • Glyphs Table 1: Example excerpt before and after processed with pages 1 le nabab, et assez audacieux 2.6 Commit 2 pour s’emparer de sa personne. Final step, which irreversibly removes all marks left behind by the previous steps and 3 1 le nabab, et assez audacieux outputs the clean version of the text. 4 Page 3 2 pour s’emparer de sa personne. _pb2_ 5 ^L La maison a vapeur Jules Verne ` ⇒3 Le faquir, - evidemment le seul ´ 6 4 entre tous que ne surexcitˆt pas a 3 Sections Ontology 7 Le faquir, - evidemment le seul ´ An ontology is used to store information relevant to the sectioning process: types of sec- 8 entre tous que ne surexcitˆt pas a tions and their relations, common section names, and ordinal and cardinal numbers. Each element in the ontology is translated to several different languages. 2.2 Sections Table 4: Excerpts from the sections ontology. Delimiting sections allows to: cap cena end 3 Algorithm PT cap´tulo, cap, ı PT cena PT fim PT terceiro, • automatically generate tables of con- capitulo FR sc`ne e FR fin terceira, Function sections(text,ontology){ tents; lines = lines from text FR chapitre, chap EN scene EN the_end trˆs, tres e • identify sections from one version of a for ( x ∈ lines: x ∈ ontology ){ EN chapter, chap BT act BT _alone EN third, three book that are missing on another ver- Add mark to text (before x) RU глава FR troisi`me, e sion; } NT sec troisieme • matching and comparing the sections } BT _numeral of two books before aligning them • ontology is being used to directly create the Perl code containing the complex data struc- (alignability); tures which are used in the process of sectioning; • perform additional processing on specific • the code is more readable and easier to maintain; sections. • the ontology can be used to discuss details with people with no programming experience. http://per-fide.di.uminho.pt/