Try it. It is part of a routine, not something that must function perfectly on its own. Anytime it does help is a win!

I would identify templates used by various sources. That is, find messages that look alike. Write code to recognize that template, and extract.

If it doesn't match that template, try to recognize the next one, and so on.

Present the text and the filled-out record to the operator. He can correct the fields, fill in the ones it didn't get, and generally have less work to do than filling out the form by hand from scratch.

Keep a new list of the ones that did not parse at all, for further investigation. Keep a list of those that needed correction, for tweeking of the parser.

I've worked that way when importing data. It didn't have to work in every case, just save me work. Pulling out the ones that worked and looking again only at what doesn't work turned out well, for identifying new patterns.

—John


In reply to Re: Extracting structured data from unstructured text - just how difficult would this be? by John M. Dlugosz
in thread Extracting structured data from unstructured text - just how difficult would this be? by clinton

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.