Skip to main content

Structural Data Extractor using LLMs

Project description

sdeul

Structural Data Extractor using LLMs

Test CI to Docker Hub Release on PyPI and GitHub

Installation

$ pip install -U sdeul

Usage

  1. Prepare a Llama 2 GGUF file.

    Example:

    $ curl -SLO https://huggingface.co/TheBloke/Llama-2-13B-chat-GGUF/resolve/main/llama-2-13b-chat.Q4_K_M.gguf
    
  2. Create a JSON Schema file for the output

  3. Extract structural data from given text using sdeul extract.

    Example:

    sdeul extract --pretty-json \
        llama-2-13b-chat.Q4_K_M.gguf \
        test/data/medication_history.schema.json \
        test/data/patient_medication_record.txt
    

    Expected output:

    {
      "MedicationHistory": [
        {
          "MedicationName": "Lisinopril",
          "Dosage": "10mg daily",
          "Frequency": "daily",
          "Purpose": "hypertension"
        },
        {
          "MedicationName": "Metformin",
          "Dosage": "500mg twice daily",
          "Frequency": "twice daily",
          "Purpose": "type 2 diabetes"
        },
        {
          "MedicationName": "Atorvastatin",
          "Dosage": "20mg at bedtime",
          "Frequency": "at bedtime",
          "Purpose": "high cholesterol"
        }
      ]
    }
    

Run sdeul --help for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdeul-0.1.2.tar.gz (42.7 kB view hashes)

Uploaded Source

Built Distribution

sdeul-0.1.2-py3-none-any.whl (31.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page