GithubHelp home page GithubHelp logo

amoabakelvin / llm_data_parser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from repollo/llm_data_parser

0.0 0.0 0.0 5 KB

This is a proof-of-concept of using an LLM to find and extract meaningful data without parsing the html too much.

Python 100.00%

llm_data_parser's Introduction

LLM Data Parser

This proof-of-concept script demonstrates how to use a language model (LLM) like GPT-3 or GPT-4 to find and extract meaningful data from HTML data without extensive HTML parsing, in this case is extracting relelvant data related to product stock and availability from a list of webpages. It uses the Langchain library to achieve this goal.

Installation

To run this script, you need to have Python 3.11.3 and the following libraries installed:

  • requests
  • json
  • openai
  • time
  • bs4
  • langchain

The recommended approach is to use a Python virtual environment:

python3 -m venv venv
. venv/bin/activate

Then, install the required libraries using pip:

pip install -r requirements.txt

Additionally, you need to have an OpenAI API key, which can be obtained from their website.

Usage

To use this script, simply run the main() function. The script will scrape product links from the target website and then use the LLM to query each product's availability.

The results will be printed to the console in the specified format.

As an alternative to OpenAI, you can use GPT4All with the Langchain library, which is a free and open-source model. For more information on using GPT4All with Langchain, refer to the following link:

https://python.langchain.com/en/latest/modules/models/llms/integrations/gpt4all.html

For a detailed explanation of the code, you can visit the following resources:

Credits

This script was extended by repollo from the original code by Prompt Engineering, as shown in this YouTube video: https://www.youtube.com/watch?v=TLf90ipMzfE

llm_data_parser's People

Contributors

repollo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.