You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+24-11
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,20 @@
1
1
# Mapping the Data Landscape For Generalizable Scientific Models
2
2
3
-
This is a WIP that builds a knowledge base to store structured information extracted from scientific publications, datasets and articles using LLMs.
3
+
We introduce a method to build a knowledge base to store structured information extracted from scientific publications, datasets and articles by leveraging large language models!
4
4
5
-
We want to cover all of "science", and perform semantic search and interact with the tool.
5
+
We want to cover all of "science", and perform semantic search over scientific literature for highly specific knowledge discovery.
6
6
7
-
This tool helps us identify the gaps where current foundation models lack coverage and where they can generalize well. It also helps us discover overlaps of methods used across different fields, that can help facilitate in building more unified foundation models for science.
7
+
This tool helps us to find aggregate information and statistics pertaining to current state of scientific research, identify the gaps where current foundation models lack coverage and where they can generalize well, and helps discover overlaps of methods used across different fields, which can help facilitate in building more unified foundation models for science.
8
8
9
-
We use the Llama-3-70B-Instruct model for structured information extraction.
9
+
### Example Preview: Concept Co-occurrence Connectivity Graph for Astrophysics!
We use the Llama-3-70B-Instruct model with 2 A100 80GB GPUs for structured information extraction.
10
18
11
19
## Workflow
12
20
@@ -54,7 +62,7 @@ pre-commit install
54
62
55
63
## Running the tool
56
64
57
-
### 1. Download raw data from arXiv
65
+
### On new data: Download raw data from arXiv
58
66
59
67
Run `scripts/collect_data.py` to download papers for arXiv:
60
68
```
@@ -66,15 +74,15 @@ These are the default arguments, you can modify them to specify the arxiv channe
66
74
The data is stored in the `data/raw/<out_dir>` directory.
67
75
The `out_dir` is a required argument that creates a new directory in `data/raw` and stores the scraped data in a jsonl file inside `data/raw/<out_dir>`. Refer to the [raw data README](data/raw/README.md) to see how the files are named.
68
76
69
-
### 2. Schema and Annotations
77
+
### Schema and Annotations
70
78
71
79
A schema was prepared by the authors of this project who were also the annotators for a small subset of the downloaded papers.
72
80
This schema defined tags to extract concepts from the downloaded scientific papers. They were used as reference by the annotators when manually creating a small subset of annotated papers. They were also passed as instructions to the language model to tag the papers. A set of consituency tests were also defined to resolve ambiguity and guide the annotation process.
73
81
74
82
The schema, tests and manual_annotations are stored in the `data/manual` directory. Refer to the [README on manual work](data/manual/README.md) done for the extraction process.
75
83
76
84
77
-
### 3. Run the model on downloaded arXiv raw data
85
+
### Run the model on downloaded arXiv raw data
78
86
79
87
Run `main.py` to call Llama-3 70B Instruct and perform extractions on the downloaded papers from any of the `data/raw` folders using Slurm jobs:
80
88
```
@@ -100,7 +108,7 @@ Options:
100
108
--help Show this message and exit.
101
109
```
102
110
103
-
We use 2 A100 80GB GPUs to perform extractions with Llama-370B. You can choose a different model if limited by memory and GPU. Since we ust the Huggingface transformers API and the model hosted on Huggingface, any new model you want to load should be hosted there as well.
111
+
If bound by compute resources and unable to use the Llama-3-70B-Instruct model, you can choose a different model if limited by memory and GPU. Since we use the Huggingface transformers library and the model hosted on Huggingface, any new model you want to load should be hosted there as well.
104
112
105
113
**Note:** In the eval mode when running on the dev set, the model was run for different sweeps for prompt optimization. The sweep details are stored in `sweep_config.json`.
106
114
@@ -123,7 +131,7 @@ The current best performance on the dev set:
123
131
124
132
The processed data gets stored in `data/raw/results` under new directories named with arguments passed to `main.py`. Refer to the [results README](data/results/README.md) for inspecting the files that each directory stores and the naming convention.
125
133
126
-
### 4. To create a SQLite3 database of the predictions, run:
134
+
### Create a SQLite3 database of the predictions
127
135
```
128
136
python scripts/create_db.py --data_path <path to the jsonl file with data> --pred_path <path to the predictions.json file>
129
137
```
@@ -141,11 +149,16 @@ Options:
141
149
```
142
150
143
151
All current databases are in the ```data/databases``` directory which can be downloaded and loaded with ```sqlite3``` to run queries on your own terminal. Refer to the [databases README](data/databases/README.md) for information on the tables that constitute each of the databases.
152
+
153
+
## Run an existing DB
154
+
155
+
To run an existing database in the `databases` directory:
156
+
144
157
```
145
158
sqlite3 databases/<table_name>
146
159
```
147
160
148
-
### 5. To launch a Gradio interface for SQL query search over the created databases, run:
161
+
##Launch a Gradio interface for SQL query search over the created databases
149
162
```
150
163
gradio scripts/run_db_interface.py
151
164
```
@@ -162,4 +175,4 @@ The interface shows all the created databases in the `data/databases` directory
162
175
### Research Papers
163
176
- Knowledge Graph in Astronomical Research with Large Language Models: Quantifying Driving Forces in Interdisciplinary Scientific Discovery | [arXiv](https://arxiv.org/pdf/2406.01391)
164
177
- Graph of Thoughts: Solving Elaborate Problems with Large Language Models | [arXiv](https://arxiv.org/pdf/2308.09687)
165
-
- Bring Your Own KG: Self-Supervised Program Synthesis for Zero-Shot KGQA | [arXiv](https://arxiv.org/pdf/2311.07850)
178
+
- Bring Your Own KG: Self-Supervised Program Synthesis for Zero-Shot KGQA | [arXiv](https://arxiv.org/pdf/2311.07850)
0 commit comments