Metadata-Version: 2.4
Name: exsclaim
Version: 2.5.2b17
Summary: EXSCLAIM! is a library for the automatic EXtraction, Separation, and Caption-based natural Language Annotation of IMages from scientific figures.
Author-email: Eric Schwenker <developer@materialeyes.org>, Trevor Spreadbury <developer@materialeyes.org>, Weixin Jiang <developer@materialeyes.org>, Maria Chan <developer@materialeyes.org>
Maintainer-email: Len Washington III <developer@materialeyes.org>
Project-URL: Homepage, https://exsclaim.materialeyes.org
Project-URL: Source, https://github.com/MaterialEyes/exsclaim2.0
Project-URL: Documentation, https://github.com/MaterialEyes/exsclaim2.0/wiki
Project-URL: Issues, https://github.com/MaterialEyes/exsclaim2.0/issues
Project-URL: Paper, https://arxiv.org/abs/2103.10631
Project-URL: Changelog, https://github.com/MaterialEyes/exsclaim2.0/blob/dev/CHANGELIST.md
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Framework :: Dash
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: JavaScript
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Text Processing
Requires-Python: >=3.13.2
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy==2.5.2
Requires-Dist: opencv-contrib-python-headless==5.0.0.93
Requires-Dist: Pillow==12.3.0
Requires-Dist: ultralytics==8.4.152
Requires-Dist: pi_heif==1.4.0
Requires-Dist: httpx2==2.13.0
Requires-Dist: brotli==1.2.0
Requires-Dist: playwright==1.62.0
Requires-Dist: playwright-stealth==2.0.3
Requires-Dist: urllib3==2.7.0
Requires-Dist: beautifulsoup4==4.15.0
Requires-Dist: soupsieve==2.9.2
Requires-Dist: tqdm==4.68.3
Requires-Dist: curl-cffi==0.16.3
Requires-Dist: asyncpg==0.31.0
Requires-Dist: cairosvg==2.9.1
Requires-Dist: pycocotools==2.0.11
Requires-Dist: PyYAML==6.0.3
Requires-Dist: pymupdf==1.28.2
Requires-Dist: torch==2.14.0
Requires-Dist: torchvision==0.29.0
Requires-Dist: pytorch-model-summary==0.1.2
Requires-Dist: datasets==5.0.0
Requires-Dist: openai==3.13.0
Requires-Dist: asksageclient==1.42
Requires-Dist: dash[async,compress]==4.4.1
Requires-Dist: flask==3.1.3
Requires-Dist: dash-extensions==2.0.6
Requires-Dist: dash-ag-grid==35.3.0
Requires-Dist: fastapi[standard]==0.141.1
Requires-Dist: pydantic==2.13.5
Requires-Dist: starlette==1.6.0
Requires-Dist: uvicorn==0.53.0
Requires-Dist: hypercorn==0.18.0
Requires-Dist: sqlmodel==0.0.44
Requires-Dist: sqlalchemy==2.0.52
Requires-Dist: pydantic_settings==2.15.0
Requires-Dist: orjson==3.12.0
Requires-Dist: pyjwt==2.14.0
Requires-Dist: cryptography==50.0.1
Requires-Dist: uuid-utils==0.17.0; python_version < "3.14"
Requires-Dist: dash_bootstrap_components==2.0.4
Requires-Dist: gunicorn[gevent]==26.2.0
Requires-Dist: alembic==1.20.0
Provides-Extra: ollama
Requires-Dist: ollama~=0.6.2; extra == "ollama"
Provides-Extra: test
Requires-Dist: Faker==40.36.0; extra == "test"
Requires-Dist: pytest-asyncio==1.4.0; extra == "test"
Requires-Dist: deepdiff==8.6.2; extra == "test"
Requires-Dist: unidecode==1.4.0; extra == "test"
Requires-Dist: pytest-asyncio==1.4.0; extra == "test"
Requires-Dist: pytest-env==1.7.0; extra == "test"
Provides-Extra: dev
Requires-Dist: ipython==9.15.0; extra == "dev"
Requires-Dist: pydevd==3.5.0; extra == "dev"
Requires-Dist: pydevd_pycharm~=263.4732.31; extra == "dev"
Requires-Dist: pytest==9.1.1; extra == "dev"
Requires-Dist: scipy-stubs==1.18.0.0; extra == "dev"
Requires-Dist: trio==0.33.0; extra == "dev"
Requires-Dist: ruff==0.16.8; extra == "dev"
Dynamic: license-file

# EXSCLAIM2.0: LLM-powered Automatic **EX**traction, **S**eparation, and **C**aption-based natural **L**anguage **A**nnotation of **IM**ages from scientific figures
[![License](https://img.shields.io/github/license/MaterialEyes/exsclaim2.0.svg?color=blue)](https://github.com/MaterialEyes/exsclaim2.0/blob/main/LICENSE)
[![Release](https://img.shields.io/github/release/MaterialEyes/exsclaim2.0.svg)](https://github.com/MaterialEyes/exsclaim2.0/releases)
[![DOI](https://zenodo.org/badge/DOI/10.48550/arXiv.2103.10631.svg)](https://arxiv.org/abs/2103.10631)
<br>
[![Production Website](https://img.shields.io/website?url=https%3A%2F%2Fexsclaim.materialeyes.org%2F&up_message=online&down_message=offline&down_color=red&label=Production%20Website)](https://exsclaim.materialeyes.org)
[![Production API](https://img.shields.io/website?url=https%3A%2F%2Fapi.exsclaim.materialeyes.org%2F&up_message=online&down_message=offline&down_color=red&label=Production%20API)](https://api.exsclaim.materialeyes.org)
[![Development Website](https://img.shields.io/website?url=https%3A%2F%2Fexsclaim-dev.materialeyes.org%2F&up_message=online&down_message=offline&down_color=red&label=Development%20Website)](https://exsclaim-dev.materialeyes.org)
[![Development API](https://img.shields.io/website?url=https%3A%2F%2Fexsclaim-dev.materialeyes.org%2F&up_message=online&down_message=offline&down_color=red&label=Development%20API)](https://api.exsclaim-dev.materialeyes.org)

## 🤔 Consider Collaboration

If you find this tool or any of its derived capabilities useful, please consider registering as a user of Center for Nanoscale Materials. We will keep you posted of latest developments, as well as opportunities for computational resources, relevant data, and collaboration. Please contact Maria Chan ([mchan@anl.gov](mailto:mchan@anl.gov)) for details.

## Introduction to EXSCLAIM2.0

EXSCLAIM2.0 is a Python package combining EXSCLAIM! code with Large Language models (LLMs) that can be used for the automatic generation of datasets of labeled images from published papers.
There are four main steps:
1. [JournalScraper](https://github.com/MaterialEyes/exsclaim2.0/wiki/JournalScraper): scrape journal websites, acquiring figures, captions, and metadata
2. [CaptionDistributor](https://github.com/MaterialEyes/exsclaim2.0/wiki/CaptionDistributor): separate figure captions into the component chunks that refer to the figure's subfigures using LLMs and prompt engineering
3. [FigureSeparator](https://github.com/MaterialEyes/exsclaim2.0/wiki/FigureSeparator): separate figures into subfigures, detect scale information, label, and type of image
4. [PDFScraper](https://github.com/MaterialEyes/exsclaim2.0/wiki/PDFScraper): scrape journal articles in PDF form, acquiring figures, captions and metadata.

## Examples and tutorials
We provide several tutorials demonstrating how to use EXSCLAIM2.0:
1. [Nature_exsclaim_search](/jupyter/1_Nature_exsclaim_search.ipynb): automatically scrapping data from literature and performing Named Entity Recognition (NER) on the extracted captions.
2. [HTMLScraper](/jupyter/2_HTMLScraper.ipynb): automatically scrapping data from user provided HTML files
3. [Microscopy_CLIP_retrieval](/jupyter/3_Microscopy_CLIP_retrieval.ipynb): Using Microscopy_CLIP to perform image-to-image and text-to-image retrieval on our multimodal microscopy dataset.


## Installation
The guides to install EXSCLAIM through Pip, Git and Docker can be found within the [wiki](https://github.com/MaterialEyes/exsclaim2.0/wiki/Installation).
The guides include installing pre-compiled versions as well as building from the source code and then installing.

### Using Exsclaim 2.0
```python
from exsclaim import Pipeline
search_query = {
		...
}
results = Pipeline(search_query)
```
where `search_query` is either a dictionary representing a valid JSON object, or a Pathlike string pointing towards a valid JSON file,
or 
```shell
python -m exsclaim query {path to json file holding search query}
```
More extensive guides can be found within the [wiki](https://github.com/MaterialEyes/exsclaim2.0/wiki/Running-the-EXSCLAIM-Pipeline).

### Using Docker Compose
To use Docker Compose to host the service, run the following commands in the base directory:
```shell
docker compose up --build python
```

## Upgrading the Database
Starting with version 2.5.3, EXSCLAIM will be using [Alembic](https://alembic.sqlalchemy.org/en/latest/index.html) to easily upgrade the schema of the database.
If you have a version of the database existing before this change, you can run
```shell
alembic stamp 751d7ac35cd2
```
to have alembic recognize that the database already has a history, then run
```shell
alembic upgrade head
```
to update the database.
With future versions, you can then run
```shell
alembic upgrade head
```
to update to the proper schema.

## Acknowledgements
This material is based upon work supported by Laboratory Directed Research and Development (LDRD) funding from Argonne National Laboratory, provided by the Director, Office of Science, of the U.S. Department of Energy under Contract No. DE-AC02-06CH11357

This work was performed at the Center for Nanoscale Materials, a U.S. Department of Energy Office of Science User Facility, and supported by the U.S. Department of Energy, Office of Science, under Contract No. DE-AC02-06CH11357.

We gratefully acknowledge the computing resources provided on Bebop, a high-performance computing cluster operated by the Laboratory Computing Resource Center at Argonne National Laboratory.

## Citation
If you find EXSCLAIM! useful, please encourage its development by citing the following [paper](https://arxiv.org/abs/2103.10631) in your research:
```
Schwenker, E., Jiang, W. Spreadbury, T., Ferrier N., Cossairt, O., Chan M.K.Y., EXSCLAIM! - An automated pipeline for the construction and
labeling of materials imaging datasets from scientific literature. arXiv e-prints (2021): arXiv-2103
```

#### Bibtex
```
@article{schwenker2021exsclaim,
  title={EXSCLAIM! - An automated pipeline for the construction of labeled materials imaging datasets from literature},
  author={Schwenker, Eric and Jiang, Weixin and Spreadbury, Trevor and Ferrier, Nicola and Cossairt, Oliver and Chan, Maria KY},
  journal={arXiv e-prints},
  pages={arXiv--2103},
  year={2021}
}
```
