Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Invoice Extractor with Gemini

This project sets up a Streamlit app for extracting invoice information using the Gemini model.

Setup

  1. Dependencies Installation: Install the required dependencies by running pip install -r requirements.txt.

  2. Google API Key: Obtain a Google API key and store it in the environment variable GOOGLE_API_KEY.

  3. Run the App: Execute the main() function to run the Streamlit app.

Usage

  1. Input Prompt: Enter the input prompt in the provided text input field.

  2. Image Upload: Upload an image of the invoice.

  3. Search: Click on the "Search" button to generate the response based on the input prompt and uploaded image.

  4. Response Display: The response generated by the Gemini model will be displayed below the "Search" button.

Functionality

  • load_key(): Loads the Google API key from the environment variable.

  • gemini_init(model_type='gemini-pro-vision'): Initializes a GenerativeModel object using the specified model type.

  • get_response(model, image, user_prompt, input_prompt=input_prompt): Generates content based on the prompts and returns the generated response as a string.

  • main(): Sets up a Streamlit app for extracting invoice information using the Gemini model.

File Structure

  • src/: Contains the source code files.
    • prompt.py: Provides input prompt.
  • README.md: Documentation file.
  • requirements.txt: Lists the project dependencies.

License

This project is licensed under the MIT License.

About

The Invoice Extractor with Gemini is a Streamlit app leveraging AI to extract invoice details from text prompts and image uploads, simplifying invoice processing with accuracy and ease.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages