Skip to content

Commit

Permalink
Add extension guidance
Browse files Browse the repository at this point in the history
  • Loading branch information
ppinchuk committed Apr 29, 2024
1 parent 4194cf6 commit 8c32394
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions examples/ordinance_gpt/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ Setup
There are a few key things you need to set up in order to run ordinance retrieval and extraction.
First, you must specify which counties you want to process. You can do this by setting up a CSV file
with a ``County`` and a ``State`` column. Each row in the CSV file then represents a single county to process.
See the `example CSV <https://github.com/NREL/elm/tree/pp/ords/examples/ordinance_gpt/counties.csv>`_
See the `example CSV <https://github.com/NREL/elm/blob/main/examples/ordinance_gpt/counties.csv>`_
file for reference.

Once you have set up the county CSV, you can fill out the
`template JSON config <https://github.com/NREL/elm/tree/pp/ords/examples/ordinance_gpt/config.json>`_.
`template JSON config <https://github.com/NREL/elm/blob/main/examples/ordinance_gpt/config.json>`_.
See the documentation for the `"process_counties_with_openai" function <https://github.com/NREL/elm/blob/main/elm/ords/process.py>`_
for an explanation of all the allowed inputs to the configuration file.
Some notable inputs here are the ``azure*`` keys, which should be configured to match your Azure OpenAI API
deployment (unless it's defined in your environment with the ``AZURE_OPENAI_API_KEY``, ``AZURE_OPENAI_VERSION``,
and ``AZURE_OPENAI_ENDPOINT`` keys, in which case you can remove these keys completely),
Expand Down Expand Up @@ -53,3 +55,14 @@ Debugging
Not sure why things aren't working? No error messages? Make sure you run the CLI call with a ``-v`` flag for "verbose" logging (e.g., ``$ elm ords -c config.json -v``)

Errors on import statements? Trouble importing ``pdftotext`` with cryptic error messages like ``symbol not found in flat namespace``? Follow the `ordinance-specific install instructions <https://github.com/NREL/elm/blob/main/elm/ords/README.md>`_ *exactly*.

Extension to Other Technologies
===============================
Extending this functionality to other technologies is possible but requires deeper understanding of the underlying processes.
We recommend you start out by examining the decision tree queries in `graphs.py <https://github.com/NREL/elm/blob/main/elm/ords/extraction/graphs.py>`_
as well as how they are applied in `parse.py <https://github.com/NREL/elm/blob/main/elm/ords/extraction/parse.py>`_. Once you
have a firm understanding of these two modules, look through the
`document validation routines <https://github.com/NREL/elm/blob/main/elm/ords/validation>` to get a better sense of how to
adjust the web-scraping portion of the code to your technology. When you have set up the validation and parsing for your
technology, put it all together by adjusting the `"process_counties_with_openai" function <https://github.com/NREL/elm/blob/main/elm/ords/process.py>`_
to call your new routines.

0 comments on commit 8c32394

Please sign in to comment.