Graph Language Models
Project description
Graph Language Models
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,
- apply NLP on document(s)
poetry run python ./deepsearch_glm/nlp_apply_on_docs.py --pdf './data/documents/articles/2305.*.pdf' --models 'language;term'
- analyse NLP on document(s)
poetry run python ./deepsearch_glm/nlp_apply_on_docs.py --json './data/documents/articles/2305.*.nlp.json'
- 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
- Query and download document(s)
poetry run python ./deepsearch_glm/utils/ds_query.py --index patent-uspto --query "\"global warming potential\" AND \"etching\""
- 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
- train simple NLP models
./nlp.exe -m train -c nlp_train_config.json
- leverage pre-trained models
./nlp.exe -m predict -c nlp_predict.example.json
Graph Language Models (GLM)
- create a GLM
./glm.exe -m create -c glm_config_create.json
- explore interactively the GLM
./glm.exe -m explore -c glm_config_explore.json
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for deepsearch_glm-0.1.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f5e6d11485a9486c32842cf4639baf81fdd6306458710d614fae2fc71021363 |
|
MD5 | a00494b366e06791e59d22986c8def22 |
|
BLAKE2b-256 | be877bb3b1e66e5dc7b801deed892c6346e48927e6ffba7061b4d9376b2de8ea |