Skip to content

This project aims to use the OpenAI Function Calling to extract required data from given several kinds of invoice PDF files.

License

Notifications You must be signed in to change notification settings

hi-tech-AI/Invoice-OCR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To run this PHP script on a Linux environment, you'll need to follow these steps:

Step 1: Set Up Your Environment

  1. Install PHP: Make sure you have PHP installed on your Linux system. You can install it using the package manager:

    sudo apt update
    sudo apt install php
  2. Install Composer: You'll need Composer to manage dependencies. If it's not already installed, you can install it using:

    sudo apt install composer
  3. Clone/Prepare Your Project: Ensure your PHP files (index.php, mindee.php) and the composer.json file (if applicable) are all in the same directory.

Step 2: Install Dependencies

Navigate to your project directory in the terminal and run the following command to install dependencies through Composer:

composer install

This will read the composer.json file and install packages like Smalot\PdfParser, Dotenv, OpenAI\Client, and Mindee\Client.

Step 3: Set Up Environment Variables

Create a .env file in your project directory with your required API keys:

OPENAI_API_KEY=your_openai_api_key_here
MINDEE_API_KEY=I_will_provide_this_key

Step 4: Run the Script

Finally, execute the PHP script with the following command:

php index.php

Additional Notes

  • Ensure Proper File Permissions: Make sure the PDF file you are processing (e.g., example.pdf) and the output path (example.json) have appropriate permissions for reading and writing.

  • Verify PHP and Composer Installation: You can check the installed version of PHP and Composer using:

    php -v
    composer -V
  • Error Handling: Look out for any errors during execution and ensure all libraries are properly installed. If there are issues with missing classes or functions, verify that all dependencies are correctly listed in your composer.json and installed via composer install.

By following these steps, you should be able to run your PHP script in a Linux environment successfully.

About

This project aims to use the OpenAI Function Calling to extract required data from given several kinds of invoice PDF files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages