Skip to main content

A tool for extracting information from disclosure statements.

Reason this release was yanked:

OpenAI broken release, downgraded httpx requirement

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. After dowlnoading the results, you need to combine the results back to the original dataset using the following command:

python core/src/influencemapper/cli.py combine -data data/test.jsonl -result batch*.jsonl study_org
python core/src/influencemapper/cli.py combine -data data/test.jsonl -result batch*.jsonl author_org

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.1.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.1-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: influencemapper-0.9.1.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.1.tar.gz
Algorithm Hash digest
SHA256 be36edfb2b956c92acdd9787feb215212292b780f6b51674a43bb226085fa780
MD5 578ab4fa0f54fbc20ef77040d2ef0116
BLAKE2b-256 003440292a6e71bdb53d8832618b792c91bcc230cbab9f255a6a0f3b05f390d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for influencemapper-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 042913d3e7231b77082425852890528c15204206d08bfb6627b70f5610e1b8aa
MD5 9c695aba7ec29a88d38900c3234bfa2d
BLAKE2b-256 56c0790379f513bb7c1abc7f58f124a4842474cda79d6b708aba19d1cd79d28b

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