Merge. Synthesize. Create. Dialektik generates new content by fusing ideas from diverse sources, revealing unexpected insights and perspectives.
Project description
Dialektik
Merge. Synthesize. Create. Dialektik generates new content by fusing ideas from diverse sources, revealing unexpected insights and perspectives through a dialectical process.
Features
- Loads and processes datasets from multiple sources
- Summarizes text into concise bullet points
- Generates thesis, antithesis, and synthesis from summarized content
- Supports various AI models for text generation
- Model-agnostic design allows easy swapping of different LLMs
Requirements
- Required:
datasets
,huggingface_hub
- Optional:
phi-3-vision-mlx
(required only if you need to create a new dataset with the providedsetup()
function for custom dataset processing)
Installation
To install Dialektik with core dependencies only:
pip install dialektik
To install Dialektik with all dependencies, including those required for the setup() function:
pip install dialektik[setup]
Note: Install the full version if you plan to process custom datasets using the setup()
function.
Usage
Command Line Interface
Dialektik can be used from the command line after installation. Here are some example usages:
-
Generate a synthesis with default settings:
dialektik
-
Specify sources:
dialektik --source arxiv
-
Set the number of books, bullet points per book, and choose a different model:
dialektik --num-book 5 --per-book 4 --model "your-preferred-model"
-
Run the setup function:
dialektik --setup
-
For a full list of options, use:
dialektik --help
Python API
You can also use Dialektik in your Python scripts:
from dialektik import synthesize
# Generate a synthesis with default settings
thesis, antithesis, synthesis = synthesize()
# Customize the synthesis process
output = synthesize(
list_source=['your_source'],
num_book=3,
per_book=3,
api_model="mistralai/Mistral-Nemo-Instruct-2407"
)
Accessing the Dataset
The default dataset at 'JosefAlbers/StampyAI-alignment-research-dataset' is publicly available. You don't need to set up any environment variables or run the setup() function to use dialektik
with this dataset.
(Optional) Using Custom Datasets
If you want to use your own dataset:
- Prepare your dataset according to the required format.
- Modify the
PATH_DS
variable in the code to point to your dataset. - If your dataset is private or requires authentication, set up the following environment variables:
HF_WRITE_TOKEN
: Hugging Face write token (for pushing datasets)HF_READ_TOKEN
: Hugging Face read token (for accessing private datasets)
Note: The setup()
function provided in the code is a demonstration of how you might process a custom dataset. Different datasets may require different processing steps, so you'll need to adapt this function to your specific needs.
Customizing the LLM
Dialektik is designed to be model-agnostic. The default model is "mistralai/Mistral-Nemo-Instruct-2407", but you can easily change this by passing a different api_model
parameter to the synthesize()
function.
Output
The synthesize()
function generates three outputs:
- Thesis: An article exploring the main themes and insights from the selected sources.
- Antithesis: A text presenting alternative perspectives and counterarguments to the thesis.
- Synthesis: A reconciliation of the thesis and antithesis, presenting a new, unified viewpoint.
All outputs are saved in the 'syntheses' folder with timestamps for easy reference.
License
This project is licensed under the MIT License.
Citation
Contributing
Contributions to Dialektik are always welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dialektik-0.0.2.tar.gz
.
File metadata
- Download URL: dialektik-0.0.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ec7e78789889d4f396e877d70e3269d38ed3272daabebf133a382a298486ead |
|
MD5 | a759ebc249d6db93f488c2f1128ca938 |
|
BLAKE2b-256 | 22b06bd6ae19b608e63237ea971286cdde9c3dae644d6ba015aede26ee6ec0df |
File details
Details for the file dialektik-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: dialektik-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5df70a55d1ec7d8761c6171a81987af9f22fde7f0a28c12a42f8eca4868fcdc5 |
|
MD5 | ee70300f16453a51747cf26ca7e31049 |
|
BLAKE2b-256 | 89667a53111135b78366ec3c28670fac9cb7a3c99790c087ae3db5b829ca1cc3 |