Skip to main content

Graph Language Models

Project description

Graph Language Models

build PyPI version PyPI - Python Version License MIT

Install

Python installation

To use the python interface, first make sure all dependencies are installed. We use poetry for that. To install all the dependent python packages and get the python bindings, simply execute,

poetry install

CXX compilation

To compile from scratch, simply run the following command in the deepsearch-glm root folder to create the build directory,

cmake -B ./build; 

Next, compile the code from scratch,

cmake --build ./build -j

Run using the Python Interface

NLP and GLM examples

To run the examples, simply do execute the scripts as poetry run python <script> <input>. Examples are,

  1. apply NLP on document(s)
poetry run python ./deepsearch_glm/nlp_apply_on_docs.py --pdf './data/documents/articles/2305.*.pdf' --models 'language;term'
  1. analyse NLP on document(s)
poetry run python ./deepsearch_glm/nlp_apply_on_docs.py --json './data/documents/articles/2305.*.nlp.json' 
  1. create GLM from document(s)
poetry run python ./deepsearch_glm/glm_create_from_docs.py --pdf ./data/documents/reports/2022-ibm-annual-report.pdf

Deep Search utilities

  1. Query and download document(s)
poetry run python ./deepsearch_glm/utils/ds_query.py --index patent-uspto --query "\"global warming potential\" AND \"etching\""
  1. Converting PDF document(s) into JSON
poetry run python ./deepsearch_glm/utils/ds_convert.py --pdf './data/documents/articles/2305.*.pdf'"

Run using CXX executables

If you like to be bare-bones, you can also use the executables for NLP and GLM's directly. In general, we follow a simple scheme of the form

./nlp.exe -m <mode> -c <JSON-config file>
./glm.exe -m <mode> -c <JSON-config file>

In both cases, the modes can be queried directly via the -h or --help

./nlp.exe -h
./glm.exe -h

and the configuration files can be generated,

./nlp.exe -m create-configs
./glm.exe -m create-configs

Natural Language Processing (NLP)

After you have generated the configuration files (see above), you can

  1. train simple NLP models
./nlp.exe -m train -c nlp_train_config.json
  1. leverage pre-trained models
./nlp.exe -m predict -c nlp_predict.example.json

Graph Language Models (GLM)

  1. create a GLM
./glm.exe -m create -c glm_config_create.json
  1. explore interactively the GLM
./glm.exe -m explore -c glm_config_explore.json

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

deepsearch_glm-0.2.2.tar.gz (153.2 kB view details)

Uploaded Source

Built Distribution

deepsearch_glm-0.2.2-cp311-cp311-macosx_13_0_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.11 macOS 13.0+ x86-64

File details

Details for the file deepsearch_glm-0.2.2.tar.gz.

File metadata

  • Download URL: deepsearch_glm-0.2.2.tar.gz
  • Upload date:
  • Size: 153.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.4.0

File hashes

Hashes for deepsearch_glm-0.2.2.tar.gz
Algorithm Hash digest
SHA256 226124991d36b5344fb2e52cb25e91affa7b8da042555a93529ea4adb7318c8a
MD5 592c4120db014cea2f818ddc0f583252
BLAKE2b-256 9c78053738c858bfb89499e6692569eb11f604ea81024c4a5b00981b82151fb3

See more details on using hashes here.

Provenance

File details

Details for the file deepsearch_glm-0.2.2-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for deepsearch_glm-0.2.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 62446bb6c55995bc886e78c17af21fb44771475caf917311d9bec4b44d696e0a
MD5 98201e52c983f9f63df97fbe1b4b83d2
BLAKE2b-256 5611fde5e45bd63a10ada45fb8b48b301814c33199e04a2174962dae2ff1c9bb

See more details on using hashes here.

Provenance

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