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. 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.8.tar.gz (16.4 kB 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.8-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: influencemapper-0.9.8.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.12 Linux/5.15.0-135-generic

File hashes

Hashes for influencemapper-0.9.8.tar.gz
Algorithm Hash digest
SHA256 ce7a51e9a471cd13f2cb6ee26acc778160cfc0c59596d6dbfab02e7f88b54ef1
MD5 3953276bce8619bc0786da0c5925d2e4
BLAKE2b-256 d42d5e7331f97214072443d486c3c5b67bcd3bc2334af780787aecc6cfdf2595

See more details on using hashes here.

File details

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

File metadata

  • Download URL: influencemapper-0.9.8-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.10.12 Linux/5.15.0-135-generic

File hashes

Hashes for influencemapper-0.9.8-py3-none-any.whl
Algorithm Hash digest
SHA256 2a43791725beb4c2c7d335d3db227ee0625a9376b057ea5bffc0c4d5a09aa9cc
MD5 b564a825c2b00120794cc45b3f901935
BLAKE2b-256 8e7f0e444c004fa92506548593a9ad00cdad3922ee3a6ba509a86c10fcdf86f5

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