Skip to main content

A tool for extracting information from disclosure statements.

Project description

InfluenceMapper

InfluenceMapper is a python library for extracting disclosure information from scholarly articles. It uses fine-tuned OpenAI's GPT models for the extraction of entities and relationships from the text. The functions included in the library are:

  • Extract entities from the text.
  • Extract relationships between authors and entities.
  • Extract relationships between entities and the study.

Installation

To install the library, run the following command:

pip install influencemapper

Training the model

The model is trained on a dataset of scholarly articles. The dataset is available at the data folder. To train the model, clone the directory and run the following command:

python core/src/influencemapper/cli.py fine_tune -train_data data/train.jsonl -valid_data data/valid.jsonl -model_name gpt-4o-mini -threshold 1500 study_org 
python core/src/influencemapper/cli.py fine_tune -train_data data/train.jsonl -valid_data data/valid.jsonl -model_name gpt-4o-mini -threshold 1500 author_org

As of the writing of this README, the resulting file has to be uploaded manually to the OpenAI platform to fine-tune the model. The model will be available for use after the fine-tuning process is completed.The threshold parameter is used to restrict samples, allowing only those with a maximum token count that meets the training requirements to pass.

Inferring entities and relationships

To infer entities and relationships from a disclosure text, run the following command:

python core/src/influencemapper/cli.py infer -data data/test.jsonl -model_name gpt-4o-mini -API_KEY [API_KEY] study_org
python core/src/influencemapper/cli.py infer -data data/test.jsonl -model_name gpt-4o-mini -API_KEY [API_KEY] author_org

To get the results, you have to visit the OpenAI platform and download the results.

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

influencemapper-0.9.0.tar.gz (8.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

influencemapper-0.9.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file influencemapper-0.9.0.tar.gz.

File metadata

  • Download URL: influencemapper-0.9.0.tar.gz
  • Upload date:
  • Size: 8.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for influencemapper-0.9.0.tar.gz
Algorithm Hash digest
SHA256 2995edf52212478771ca36caf8d448008cac685c97bbbac6e0f1a3aed2bb7050
MD5 e898e82c5ad429247f899ae28537ab42
BLAKE2b-256 863a5783ce1364916e77fd769bffefac144cf48b5fba6d04b976ac09fd53ada4

See more details on using hashes here.

File details

Details for the file influencemapper-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for influencemapper-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e4d07cbc1d85eae732cff3194b0c686e5430547141f78762bbc80ba6b79e142
MD5 66c34c7881aadefb128af19ede42b1ab
BLAKE2b-256 482c99ec9292baa69e4e02c4402fdafe02667f863fe25414f2c064128bbef0b3

See more details on using hashes here.

Supported by

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