Steps to run the application:
- Activate a virtual environment
sudo apt install python3.8-venv
python3 -m venv venv
source venv/bin/activate
- Navigate to the app directory:
cd app/
- Install requirements
pip3 install -r requirements.txt
- Start the application
streamlit run to_kg_app.py
In order to generate a knowledge graph from text you need to have an OpenAI API key.
Steps to start the script:
- Activate a virtual environment
sudo apt install python3.8-venv
python3 -m venv venv
source venv/bin/activate
- Navigate to the scripts directory:
cd scripts
- Navigate to the textToKG directory
cd textToKG/
- Install requirements
pip3 install -r requirements.txt
- Run the script by providing your Open AI API key as the first parameter
python ./toKG.py <input_dir.txt> <output_dir.ttl> <YOUR_API_KEY>
- Navigate to the deduplication directory
cd deduplication/
- Install requirements
pip3 install -r requirements.txt
- Run the deduplication script.
python ./deduplication.py <input_file.ttl> <output_file.ttl>
The deduplication step requires user interaction. It is based on python's dedupe library (https://docs.dedupe.io/en/latest/). After running the script you will receive multiple questions about deduplicated statements in your knowledge graph.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
CC-BY-SA cite as: Vasil Vasilev, Georgi Grazhdanski, Sylvia Vassileva, Ivan Koychev and Svetla Boytcheva. (2024) Large language models enhanced automatic knowledge graphs generation in medical domain. It was submitted to ESWC 2024