AI Scanning an Invoice

AI Scanning an Invoice

This new issue, dedicated to ChatGPT and Sermo (my programming gateway to ChatGPT, Perplexity, and Claude 3.5 Sonnet), will showcase the ability of LLM-based AIs (Large Language Models) to extract details from an invoice.

To demonstrate this, I'll be using a real invoice—there's really no secret to reveal or hide here.

I'll be employing a new feature of Sermo: the ability to analyze an invoice.

First, here is the scan of the invoice:

Here is the call to Sermo for detecting the information contained in the invoice:

$sermo = new Sermo();

$t1 = microtime(true);
$a = $sermo->analyzeInvoice( 'https://www.trql.fm/mazout.jpg' );
$t2 = microtime(true);

if ( preg_match( '/```xml(?P<code>.*)```/si',$a,$matches ) )
{
    $xml = $matches['code'];
    echo "<pre>",htmlentities( $xml ),"</pre>";
}

echo "<p>Performance: ",number_format( $t2 - $t1,5,',','.' )," secs to examine the invoice</p>";        

As you can see, a single line of code is enough to ask Sermo to scan the invoice. Here is the result:

<invoice>
    <recipient>
        <name>LATO SENSU MANAGEMENT</name>
        <vatNumber>BE 0878127142</vatNumber>
    </recipient>
    <issuer>
        <name>BERTRAND Combustibles</name>
        <address>
            <street>Rue du Chêne</street>
            <number>1</number>
            <postalCode>5070</postalCode>
            <locality>Fosses-la-Ville</locality>
        </address>
        <phone>0483/037209</phone>
        <email>[email protected]</email>
        <website>www.bertrandcombustibles.be</website>
        <vatNumber>BE 0742.406.430</vatNumber>
        <bankAccount>BE02 7326 6822 2240</bankAccount>
    </issuer>
    <invoiceDetails>
        <lineOfDetail>Gas oil Diesel (EXTRA) - 10PPM - 1.000 L - 748,35 EUR - 21,00 EUR - 157,15 EUR</lineOfDetail>
    </invoiceDetails>
    <invoiceNo>V1259084</invoiceNo>
    <invoiceDate>20240726</invoiceDate>
    <totalHTVA>748,35</totalHTVA>
    <totalTVA>157,15</totalTVA>
    <totalTVAC>905,50</totalTVAC>
    <prepayment></prepayment>
    <totalPaymentDue>905,50</totalPaymentDue>
    <paymentDueDate>20240726</paymentDueDate>
    <currency>EUR</currency>
    <expenseType>Heating oil</expenseType>
    <expenseAccount>61232</expenseAccount>
</invoice>
Performance: 9,68427 secs to examine the invoice        

Compare the invoice scan and the rendered result for yourself!

Since I have tailored Sermo's detection to align with Belgian accounting, I was also able to ask it to categorize the expense (currently, the categories are not predetermined) and identify the expense account that should be affected in the accounting. However, I have not yet succeeded in accurately determining this expense account or in allocating the total amount between the expense account and the VAT account. Nor have I been able to automatically determine that the credit should be made to the accounts payable (account 401). Finally, if the invoice has a total balance of 0, indicating it has been paid, I could also determine that there should be a debit to account 401 (accounts payable) and a credit to account 512 (bank). These are future developments planned for Sermo.

Conclusions

Originally just a simple algorithm that determines the next word, LLMs now offer astonishing possibilities that are chilling in their implications for the workforce and, consequently, our society. What I have just demonstrated here is that the average person might soon be able to do without an accountant. This is not science fiction; it is reality! It's already here.

In an upcoming article, I will share the new Sermo code with you.

Previous article - Next article




要查看或添加评论,请登录

Patrick Boens的更多文章

  • Forging a ChatBot in the Digital Wilderness

    Forging a ChatBot in the Digital Wilderness

    In the relentless landscape of technological evolution, silence is not the absence of action—it is the crucible of…

  • Software Engineers and AI

    Software Engineers and AI

    Through numerous articles written on the subject of artificial intelligence in the context of digital transformations…

  • Using templates to mimic sophisticated object

    Using templates to mimic sophisticated object

    The Power of Templates in IllicoDB3: Revolutionizing Database Structure In the realm of traditional databases, the…

  • More, Faster, Easier...

    More, Faster, Easier...

    In my previous article, I showed you how to create a small todo management app in record time. Now, based on this first…

  • AI at the Developers' Bedside

    AI at the Developers' Bedside

    Let's dive into the world of AI-powered app creation, showcasing just how effortless it can be to bring your ideas to…

    1 条评论
  • AI and IT

    AI and IT

    Here's the question I asked to "Sonar Huge", the AI model of Perplexity.ai: With the advent of AI taking by storm the…

  • The Imperative of AI in Digital Transformation Projects: A Wake-Up Call for Businesses

    The Imperative of AI in Digital Transformation Projects: A Wake-Up Call for Businesses

    In today's rapidly evolving digital landscape, companies that continue to approach their digital transformation and…

  • Data Migration Projects

    Data Migration Projects

    "Mise en bouche" My first interesting encounter with a data migration project dates back to 1999. The tech world was…

  • IllicoDB3 and AI

    IllicoDB3 and AI

    I have mentioned in the past that IllicoDB3 allows the use of artificial intelligence to generate code related to…

  • IllicoDB3 : The New Features

    IllicoDB3 : The New Features

    As I mentioned in a previous article, IllicoDB3 has evolved significantly, and part of its evolution stems from…

社区洞察

其他会员也浏览了