Skip to content

ligi2009/pick_hbdb_prompt_exampls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

hbdb construct context

First step

Download the hbdb2.sql

Environment Setup

Create a new conda environment

conda create --name hbdb_env python=3.10

Activate the conda environment

conda activate hbdb_env

Install necessary package

pip insall mysql-connector-python==9.1.0

Modify sql.py to match your dataset format

Replace the following line in the script with your own MySQL settings:

connection = mysql.connector.connect(host='localhost', port='3306',user='root'password='XXXXXXXX')

Ensure the host, port, user, and password match your database configuration.

  • host: The hostname or IP address of your MySQL server.
  • port: The port number your MySQL server listens on (default is 3306).
  • user: Your MySQL username.
  • password: Your MySQL password (replace XXXXXXXX with the actual password).

Construct context

Run the sql.py script with the specified compound_id parameter.

As an example, using compound "acetone," replace 28 with the desired compound ID to fetch data from the database:

python sql.py --compound_id 28

Results

The results will be stored in a directory named after the compound name. It will include all concepts related to the compound.

The JSON files will follow this naming format:

{term_A}_{term_B}_{paragraph}.json

Each JSON file will have the following structure:

{
    "term_A": "value of term A",
    "term_B": "value of term B",
    "context": "surrounding text including the target sentence"
}

About

construct examples from hbdb dataset

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages