Skip to content

Commit d3e94c9

Browse files
Merge pull request #13 from TheLucasSchwarz/B4-development
bug fixes and feature improvements to the demo
2 parents 8ea3a14 + cd69d87 commit d3e94c9

File tree

7 files changed

+324
-183
lines changed

7 files changed

+324
-183
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "zeroshot-engine"
7-
version = "0.1.2"
7+
version = "0.1.3"
88
description = "A zero-shot classification engine based on various LLM models"
99
readme = "README.md"
1010
authors = [

src/zeroshot_engine.egg-info/PKG-INFO

Lines changed: 64 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.4
22
Name: zeroshot-engine
3-
Version: 0.1.2
3+
Version: 0.1.3
44
Summary: A zero-shot classification engine based on various LLM models
55
Author-email: Lucas Schwarz <luc.schwarz@posteo.de>
66
License:
@@ -228,14 +228,24 @@ Dynamic: license-file
228228

229229
# zeroshot-engine
230230

231-
A scientific zero-shot text classification engine based on various LLM models.
231+
A open-source scientific zero-shot text classification engine based on various LLM models.
232232

233-
## Description
233+
## 📖 About this package
234+
235+
### Description
234236

235237
This project provides a flexible framework for performing zero-shot classification using large language models and pandas. It allows you to classify text into categories without requiring explicit training data for those categories. All instructions to LLMs are provided by mere natural language prompts. The framework is designed to support a wide range of text classification tasks including multi-label, multi-class, and single-class classification scenarios.
236238

237-
## Features
239+
### Purpose
240+
241+
This package was developed as part of an academic research project to systematically classify political communication. The primary goal was to create an easy-to-use and accessible framework for building adaptable zero-shot classifications with large language models (LLMs) across a wide variety of text analysis tasks. By providing a flexible and intuitive tool, this project aims to empower students and researchers — especially those in social sciences — to explore, evaluate, and harness the potential of zero-shot classification while addressing its challenges in a user-friendly environment. I have no financial interest in this project.
242+
243+
### Open-Source and Non-Commercial
244+
245+
This project is fully open-source and was developed with no financial interests. It is intended to support academic research and the broader scientific community. Contributions are welcome to help improve the framework and expand its capabilities.
238246

247+
## ✨ Features
248+
### Overview
239249
* Handles multi-label, multi-class, and single-class classification tasks.
240250
* Option for incorporating few-shot learning through the flexible prompt engineering approach.
241251
* Supports multiple LLM models (e.g., OpenAI, Ollama).
@@ -251,46 +261,33 @@ This project provides a flexible framework for performing zero-shot classificati
251261
* **Multi-Prompting:** The use of multiple different prompts for different tasks to elicit more comprehensive and reliable predictions from the model.
252262
* **Modular Prompt Design:** While not automated in the current implementation, the modular prompt design with text blocks facilitates manual testing and refinement of prompts to improve classification accuracy.
253263

264+
### Core Modules
265+
* **Iterative Double Validated Zero-Shot Classification (IDZSC)**: IDZSC is the core module to classify texts in an iterative process. It can use a double validation technique to ensure the robustness and accuracy of the classifications.
266+
* **Hierarchical Double Validated Zero-Shot Classification (HDZSC)**: HDZSC extends the zero-shot classification capabilities to hierarchical category structures. It leverages a double validation approach to maintain accuracy while navigating the complexities of hierarchical classification.
254267

255-
## Installation
256-
268+
## 🚀 Get Started
269+
### How to install
270+
Install the `zeroshot-engine` package using pip in your Windows Powershell or Linux / Mac Bash Terminal.
257271
```bash
258272
pip install zeroshot-engine
259273
```
260274

261-
## Demo
262-
275+
### Interactive Demo in the Command Line
276+
Test the `zeroshot-engine` in the HDZSC-scenario by selecting from a wide variety of LLMs and bringing your own text for classification:
263277
```bash
264278
zeroshot-engine demo
265279
```
280+
This command will guide you through an interactive demo where you can:
266281

267-
## Usage
268-
269-
```bash
270-
zeroshot-engine --help
271-
```
272-
273-
## Core Modules
274-
275-
### Iterative Double Validated Zero-Shot Classification (IDZSC)
276-
277-
IDZSC is the core module to classify texts in an iterative process. It can use a double validation technique to ensure the robustness and accuracy of the classifications.
282+
* Choose an LLM model (e.g., one from OpenAI or Ollama).
283+
* Provide your own text for classification or use a provided example text.
284+
* Observe how the hierarchical classification process works in real-time.
278285

279-
### Hierarchical Double Validated Zero-Shot Classification (HDZSC)
286+
### Run your first Zeroshot Classification Project in Python
280287

281-
HDZSC extends the zero-shot classification capabilities to hierarchical category structures. It leverages a double validation approach to maintain accuracy while navigating the complexities of hierarchical classification.
288+
This **[tutorial](docs/Tutorial_Get_Started.md)** provides example code for your first test project, which you can use as a template to build and adapt your own research projects. For more detailed information and advanced usage, please refer to the documentation.
282289

283-
### Planned Features
284-
285-
* Highest Priority: Extend functionality, that user can use more than the demo.
286-
* Improved documentation and examples.
287-
* Create prompting guidelines.
288-
* Better integration and testing of validation metrics.
289-
* Automated Logging System
290-
* Add contribution guidelines.
291-
* Support for more LLMs and APIs.
292-
293-
### Documentation
290+
## 📚 Documentation
294291
For more detailed information about the framework and its implementation, please refer to the following documentation:
295292

296293
* **[Overview of IDZSC and HDZSC](docs/Overview_IDZSC_and_HDZSC.md)** - A comprehensive explanation of the Iterative and Hierarchical Double Zero-Shot Classification approaches, including detailed examples and usage patterns.
@@ -301,10 +298,8 @@ For more detailed information about the framework and its implementation, please
301298

302299
* **[Tutorial: Get started with your first classification](docs/Tutorial_Get_Started.md)** - Create your first projects with prompt, code examples and text to learn how to set up the classifer.
303300

304-
## Example Flow Chart
301+
### Example Flow Chart
305302
```
306-
307-
308303
==============================================================
309304
ZEROSHOTENGINE DEMO LABEL DEPENDENCY FLOWCHART
310305
==============================================================
@@ -351,42 +346,62 @@ For more detailed information about the framework and its implementation, please
351346
--------------------------------------------------------------
352347
```
353348

349+
## 📅 Planned Features
354350

355-
## License
351+
* List of supported LLMs
352+
* Additional tutorial for double validation vs. zero-temp approach.
353+
* Documentation of all relevant functions.
354+
* Create prompting guidelines.
355+
* Better integration and testing of validation metrics.
356+
* Automated Logging System
357+
* Add contribution guidelines.
358+
* Support for more LLMs and APIs.
359+
360+
## 🚧 Notice: Under Development
361+
362+
> **Note:**
363+
> While the core functionality of `zeroshot-engine` is already up and running, this project is still under active development.
364+
> There may be bugs, incomplete features, or areas for improvement.
365+
>
366+
> If you encounter any issues, have feature requests, or would like to contribute code to the project, please feel free to:
367+
> - Open an issue on the [GitHub repository](https://github.com/your-repo-link/issues).
368+
> - Submit a pull request with your contributions.
369+
> - Contact the author directly at **luc.schwarz@posteo.de**.
370+
>
371+
> Contributions are highly appreciated and will help improve the framework for the scientific community!
372+
373+
## 📜 License
356374

357375
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
358376

359-
## Contributing
377+
## 🫱🏼‍🫲🏼 Contributing
360378

361-
We welcome contributions! Feel free to open issues for bug reports or feature requests. If you'd like to contribute code directly, please see our [contributing guidelines](CONTRIBUTING.md).
379+
Contributions are welcome! Feel free to open issues for bug reports or feature requests. If you'd like to contribute code directly, please see the [contributing guidelines](CONTRIBUTING.md).
362380

363-
## Author
381+
## 🤵 Author
364382

365383
Lucas Schwarz
366384

367-
## Contact
385+
## 📧 Contact
368386

369387
luc.schwarz@posteo.de
370388

371-
## Citation
389+
## 🏛️ Citation
372390

373391
If you use `zeroshot-engine` in your research, please cite it as follows:
374392

375-
> Schwarz, L. (2025) „zeroshot-engine: A scientific zero-shot text classification engine based on various LLM models“. Zenodo. doi: 10.5281/zenodo.15077242.
393+
> Schwarz, L. (2025) „zeroshot-engine: A scientific zero-shot text classification engine based on various LLM models“. Zenodo. doi: 10.5281/zenodo.15079108.
376394

377395
```bibtex
378-
@software{schwarz_2025_15077242,
396+
@software{schwarz_2025_15079108,
379397
author = {Schwarz, Lucas},
380398
title = {zeroshot-engine: A scientific zero-shot text
381399
classification engine based on various LLM models
382400
},
383401
year = 2025,
384402
publisher = {Zenodo},
385-
version = {0.1.1},
386-
doi = {10.5281/zenodo.15077242},
387-
url = {https://doi.org/10.5281/zenodo.15077242},
403+
version = {0.1.2},
404+
doi = {10.5281/zenodo.15079108},
405+
url = {https://doi.org/10.5281/zenodo.15079108},
388406
}
389407
```
390-
391-
392-
![PyPI Publishing](https://github.com/TheLucasSchwarz/zeroshot-engine/actions/workflows/python-publish.yml/badge.svg)

src/zeroshot_engine/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""zeroshot_engine package."""
22

33
# Package version
4-
__version__ = "0.1.2"
4+
__version__ = "0.1.3"
55

66
# Package metadata
77
__author__ = "Lucas Schwarz"
@@ -49,6 +49,9 @@
4949
setup_ollama,
5050
)
5151

52+
from zeroshot_engine.demo.demo_runner import run_demo_classification
53+
54+
5255
from zeroshot_engine.functions.openai import setup_openai_api_key
5356

5457
from zeroshot_engine.functions.visualization import display_label_flowchart

0 commit comments

Comments
 (0)