8000 GitHub - molmd/ElectroChemLLM · GitHub
[go: up one dir, main page]

Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Repository files navigation

BatteryExtractLLM

Overview

The goal of this project is to develop a robust, automated pipeline for extracting detailed electrolyte composition data from the full text of millions of scientific journal articles published over the past two decades. Our focus is on electrolytes relevant to electrochemical applications such as energy storage and conversion. By employing large language models (LLMs) and named entity recognition (NER) techniques, we aim to build an open-access, structured database linking electrolyte compositions to key electrochemical properties.

Requirements

python-dotenv
openai==1.76.0
pandas==2.2.3
numpy==2.2.4
black
beautifulsoup4==4.13.4
grobid-client-python
docling
pytest==8.4.1
google-genai==1.4.0

Installation

1. Clone the Repository

git clone https://github.com/manojCoe/BatteryExtractLLM
cd BatteryExtractLLM

2. Install Dependencies

Create a virtualenv

python -m venv venv
venv/Scripts/activate

Install requirements.txt

pip install -r requirements.txt

Addidtional Dependencies

Checkout GROBID-Based PDF-to-JSON Conversion Pipeline for instrcutions on how to convert your pdf to s2orc json format

3. API_KEY

We currently support GPT, Gemini and LLAMA models

  1. For OpenAI model,
Replace API_KEY in .env file with your OpenAI api_key and save
  1. For Gemini model,
Replace GEMINI_API_KEY in .env file with your Gemini api_key and save
  1. For LLama models, basic config with API key is already prefilled.

4. Command line arguments:

"--model", choices=["gpt", "llama", "gemini"], required=False, help="Which model to use (gpt, llama)", default='gpt')
"--mode", choices=["model", "section", "image"], required=False, default="model", help="Which mode to run (text model, section-wise, image)")
"--path", type=Path, required=False, help="Path to file or folder containing input(s)")
"--batch", action="store_true", help="Process pdfs in batches and query all pdfs within the folder - /input_pdfs.",

4. Running the code

For Single pdf query

python .\src\main.py --path <s2orc json_file_path>

For batch pdf querying

python .\src\main.py --batch

Troubleshooting

  1. For macos, any errors related to numpy < 2 required, set numpy==1.26.4 in requirements.txt and run pip install -r requirements.txt

Tips

Create a virtual environment if you have many versions of python or python dependencies on your system. This repo requires python >= 3.10

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0